From 6a9b404c11113902b0d2350c9a08b0e6e63ab52c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 16 Sep 2024 10:18:58 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- Tests/test_image_thumbnail.py | 1 + src/PIL/TiffImagePlugin.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Tests/test_image_thumbnail.py b/Tests/test_image_thumbnail.py index 4b827dff7..77c3a2bed 100644 --- a/Tests/test_image_thumbnail.py +++ b/Tests/test_image_thumbnail.py @@ -89,6 +89,7 @@ def test_no_resize() -> None: im.thumbnail((64, 64)) assert im.size == (64, 64) + def test_load_first_unless_jpeg() -> None: # Test that thumbnail() still uses draft() for JPEG with Image.open("Tests/images/hopper.jpg") as im: diff --git a/src/PIL/TiffImagePlugin.py b/src/PIL/TiffImagePlugin.py index bbae051bf..960423946 100644 --- a/src/PIL/TiffImagePlugin.py +++ b/src/PIL/TiffImagePlugin.py @@ -1277,7 +1277,7 @@ class TiffImageFile(ImageFile.ImageFile): @property def size(self) -> tuple[int, int]: - if hasattr(self, 'tag_v2'): + if hasattr(self, "tag_v2"): if self.tag_v2.get(ExifTags.Base.Orientation) in (5, 6, 7, 8): return (self._size[1], self._size[0]) return self._size