From 7ece94edc7d9da4d2213879e75c036c8ff283dd8 Mon Sep 17 00:00:00 2001 From: wiredfool Date: Mon, 21 Oct 2013 09:30:06 -0700 Subject: [PATCH] compression in encoder info --- PIL/TiffImagePlugin.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PIL/TiffImagePlugin.py b/PIL/TiffImagePlugin.py index 25ad3578e..89e1fd67e 100644 --- a/PIL/TiffImagePlugin.py +++ b/PIL/TiffImagePlugin.py @@ -908,7 +908,7 @@ def _save(im, fp, filename): ifd = ImageFileDirectory(prefix) - compression = im.info.get('compression','raw') + compression = im.encoderinfo.get('compression',im.info.get('compression','raw')) libtiff = compression in ["tiff_ccitt", "group3", "group4", "tiff_jpeg", "tiff_adobe_deflate", "tiff_thunderscan", "tiff_deflate", @@ -1005,6 +1005,7 @@ def _save(im, fp, filename): _fp = os.dup(fp.fileno()) blocklist = [STRIPOFFSETS, STRIPBYTECOUNTS, ROWSPERSTRIP, ICCPROFILE] # ICC Profile crashes. + atts = dict([(k,v) for (k,(v,)) in ifd.items() if k not in blocklist]) try: # pull in more bits from the original file, e.g x,y resolution