Merge pull request #3310 from radarhere/compression

Fixed None as TIFF compression argument
This commit is contained in:
Hugo 2018-09-29 19:44:43 +03:00 committed by GitHub
commit 84b4905a94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -496,7 +496,7 @@ class TestFileLibTiff(LibTiffTestCase):
pilim_load = Image.open(buffer_io)
self.assert_image_similar(pilim, pilim_load, 0)
# save_bytesio()
save_bytesio()
save_bytesio('raw')
save_bytesio("packbits")
save_bytesio("tiff_lzw")

View File

@ -1404,8 +1404,9 @@ def _save(im, fp, filename):
ifd = ImageFileDirectory_v2(prefix=prefix)
compression = im.encoderinfo.get('compression',
im.info.get('compression', 'raw'))
compression = im.encoderinfo.get('compression', im.info.get('compression'))
if compression is None:
compression = 'raw'
libtiff = WRITE_LIBTIFF or compression != 'raw'