PR feedback: simplified key construct for fillorder=2; indentation fixes

This commit is contained in:
Konstantin Kopachev 2018-09-26 09:44:45 -07:00
parent 300bdaad9e
commit 69f315a585
No known key found for this signature in database
GPG Key ID: CECF757E656F4F62
2 changed files with 9 additions and 12 deletions

View File

@ -1256,11 +1256,8 @@ class TiffImageFile(ImageFile.ImageFile):
# bits, so stripes of the image are reversed. See # bits, so stripes of the image are reversed. See
# https://github.com/python-pillow/Pillow/issues/279 # https://github.com/python-pillow/Pillow/issues/279
if fillorder == 2: if fillorder == 2:
key = ( # Replace fillorder with fillorder=1
self.tag_v2.prefix, photo, sampleFormat, 1, key = key[:3] + (1,) + key[4:]
self.tag_v2.get(BITSPERSAMPLE, (1,)),
self.tag_v2.get(EXTRASAMPLES, ())
)
if DEBUG: if DEBUG:
print("format key:", key) print("format key:", key)
# this should always work, since all the # this should always work, since all the