Rearranged code

Co-authored-by: Alexander Karpinsky <homm86@gmail.com>
This commit is contained in:
Andrew Murray 2024-09-18 21:17:49 +10:00 committed by GitHub
parent 84e275d906
commit a859695d9a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1421,12 +1421,8 @@ class TiffImageFile(ImageFile.ImageFile):
if not isinstance(xsize, int) or not isinstance(ysize, int): if not isinstance(xsize, int) or not isinstance(ysize, int):
msg = "Invalid dimensions" msg = "Invalid dimensions"
raise ValueError(msg) raise ValueError(msg)
self._will_be_transposed = self.tag_v2.get(ExifTags.Base.Orientation) in ( orientation = self.tag_v2.get(ExifTags.Base.Orientation)
5, self._will_be_transposed = orientation in (5, 6, 7, 8)
6,
7,
8,
)
if self._will_be_transposed: if self._will_be_transposed:
self._size = ysize, xsize self._size = ysize, xsize
else: else: