From 0272dc2736a204e4d7344b39c8e696559a2bff5f Mon Sep 17 00:00:00 2001 From: Joe Hultgren Date: Mon, 24 Jul 2017 13:49:18 -0700 Subject: [PATCH] Add targa version 2 footer Add the footer that is part of the version 2 spec. Some applications don't like images without the footer. Such as perforce's p4merge tool. --- PIL/TgaImagePlugin.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PIL/TgaImagePlugin.py b/PIL/TgaImagePlugin.py index 0bc52529a..2e9895d29 100644 --- a/PIL/TgaImagePlugin.py +++ b/PIL/TgaImagePlugin.py @@ -181,6 +181,9 @@ def _save(im, fp, filename, check=0): ImageFile._save( im, fp, [("raw", (0, 0) + im.size, 0, (rawmode, 0, orientation))]) + + # write targa version 2 footer + fp.write(b"\000" * 8 + "TRUEVISION-XFILE." + b"\000") # # --------------------------------------------------------------------