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.
This commit is contained in:
Joe Hultgren 2017-07-24 13:49:18 -07:00 committed by GitHub
parent 0cd84cf9b3
commit 0272dc2736

View File

@ -182,6 +182,9 @@ def _save(im, fp, filename, check=0):
ImageFile._save( ImageFile._save(
im, fp, [("raw", (0, 0) + im.size, 0, (rawmode, 0, orientation))]) 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")
# #
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# Registry # Registry