mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 09:26:16 +03:00
commit
f6766ad960
|
@ -782,6 +782,23 @@ class TiffImageFile(ImageFile.ImageFile):
|
||||||
# it doesn't use a file descriptor.
|
# it doesn't use a file descriptor.
|
||||||
fp = False
|
fp = False
|
||||||
|
|
||||||
|
# libtiff handles the fillmode for us, so 1;IR should
|
||||||
|
# actually be 1;I. Including the R double reverses the
|
||||||
|
# bits, so stripes of the image are reversed. See
|
||||||
|
# https://github.com/python-imaging/Pillow/issues/279
|
||||||
|
if fillorder == 2:
|
||||||
|
key = (
|
||||||
|
self.tag.prefix, photo, format, 1,
|
||||||
|
self.tag.get(BITSPERSAMPLE, (1,)),
|
||||||
|
self.tag.get(EXTRASAMPLES, ())
|
||||||
|
)
|
||||||
|
if Image.DEBUG:
|
||||||
|
print("format key:", key)
|
||||||
|
# this should always work, since all the
|
||||||
|
# fillorder==2 modes have a corresponding
|
||||||
|
# fillorder=1 mode
|
||||||
|
self.mode, rawmode = OPEN_INFO[key]
|
||||||
|
|
||||||
# Offset in the tile tuple is 0, we go from 0,0 to
|
# Offset in the tile tuple is 0, we go from 0,0 to
|
||||||
# w,h, and we only do this once -- eds
|
# w,h, and we only do this once -- eds
|
||||||
a = (rawmode, self._compression, fp )
|
a = (rawmode, self._compression, fp )
|
||||||
|
|
BIN
Tests/images/g4-fillorder-test.png
Normal file
BIN
Tests/images/g4-fillorder-test.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 989 B |
BIN
Tests/images/g4-fillorder-test.tif
Normal file
BIN
Tests/images/g4-fillorder-test.tif
Normal file
Binary file not shown.
|
@ -70,6 +70,14 @@ def test_g4_eq_png():
|
||||||
|
|
||||||
assert_image_equal(g4, png)
|
assert_image_equal(g4, png)
|
||||||
|
|
||||||
|
# see https://github.com/python-imaging/Pillow/issues/279
|
||||||
|
def test_g4_fillorder_eq_png():
|
||||||
|
""" Checking that we're actually getting the data that we expect"""
|
||||||
|
png = Image.open('Tests/images/g4-fillorder-test.png')
|
||||||
|
g4 = Image.open('Tests/images/g4-fillorder-test.tif')
|
||||||
|
|
||||||
|
assert_image_equal(g4, png)
|
||||||
|
|
||||||
def test_g4_write():
|
def test_g4_write():
|
||||||
"""Checking to see that the saved image is the same as what we wrote"""
|
"""Checking to see that the saved image is the same as what we wrote"""
|
||||||
file = "Tests/images/lena_g4_500.tif"
|
file = "Tests/images/lena_g4_500.tif"
|
||||||
|
@ -95,3 +103,5 @@ def test_adobe_deflate_tiff():
|
||||||
assert_equal(im.size, (278, 374))
|
assert_equal(im.size, (278, 374))
|
||||||
assert_equal(im.tile[0][:3], ('tiff_adobe_deflate', (0, 0, 278, 374), 0))
|
assert_equal(im.tile[0][:3], ('tiff_adobe_deflate', (0, 0, 278, 374), 0))
|
||||||
assert_no_exception(lambda: im.load())
|
assert_no_exception(lambda: im.load())
|
||||||
|
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user