mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-04-29 13:33:43 +03:00
Merge pull request #1594 from wiredfool/g4_attributes
Allow saving RowsPerStrip with libtiff.
This commit is contained in:
commit
6005800396
|
@ -1277,8 +1277,10 @@ def _save(im, fp, filename):
|
||||||
except io.UnsupportedOperation:
|
except io.UnsupportedOperation:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# ICC Profile crashes.
|
# STRIPOFFSETS and STRIPBYTECOUNTS are added by the library
|
||||||
blocklist = [STRIPOFFSETS, STRIPBYTECOUNTS, ROWSPERSTRIP, ICCPROFILE]
|
# based on the data in the strip.
|
||||||
|
# ICCPROFILE crashes.
|
||||||
|
blocklist = [STRIPOFFSETS, STRIPBYTECOUNTS, ICCPROFILE]
|
||||||
atts = {}
|
atts = {}
|
||||||
# bits per sample is a single short in the tiff directory, not a list.
|
# bits per sample is a single short in the tiff directory, not a list.
|
||||||
atts[BITSPERSAMPLE] = bits[0]
|
atts[BITSPERSAMPLE] = bits[0]
|
||||||
|
|
|
@ -165,6 +165,13 @@ class TestFileLibTiff(LibTiffTestCase):
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
val, value, msg="%s didn't roundtrip" % tag)
|
val, value, msg="%s didn't roundtrip" % tag)
|
||||||
|
|
||||||
|
# https://github.com/python-pillow/Pillow/issues/1561
|
||||||
|
requested_fields = ['StripByteCounts',
|
||||||
|
'RowsPerStrip',
|
||||||
|
'StripOffsets']
|
||||||
|
for field in requested_fields:
|
||||||
|
self.assertTrue(field in reloaded, "%s not in metadata" %field)
|
||||||
|
|
||||||
def test_g3_compression(self):
|
def test_g3_compression(self):
|
||||||
i = Image.open('Tests/images/hopper_g4_500.tif')
|
i = Image.open('Tests/images/hopper_g4_500.tif')
|
||||||
out = self.tempfile("temp.tif")
|
out = self.tempfile("temp.tif")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user