Testing default pil implemented compressions with libtiff

This commit is contained in:
wiredfool 2013-11-21 22:13:57 -08:00
parent 94e3c75179
commit 60c93ce1b1

View File

@ -220,14 +220,26 @@ def test_blur():
assert_image_equal(im, im2)
def test_packbits():
def test_compressions():
im = lena('RGB')
out = tempfile('temp.tif')
im.save(out, compression='packbits')
#TiffImagePlugin.READ_LIBTIFF = True
#TiffImagePlugin.WRITE_LIBTIFF = True
for compression in ('packbits', 'tiff_lzw'):
im.save(out, compression=compression)
im2 = Image.open(out)
assert_image_equal(im, im2)
im.save(out, compression='jpeg')
im2 = Image.open(out)
assert_image_similar(im, im2, 30)
TiffImagePlugin.READ_LIBTIFF = False
TiffImagePlugin.WRITE_LIBTIFF = False
def test_cmyk_save():