From ffc6939d1686c6fc53ab6cb0c907e14f31db4d3a Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Wed, 1 Jan 2025 09:02:37 +1100 Subject: [PATCH] Keep ImageFile type hint --- Tests/test_file_iptc.py | 2 +- src/PIL/IptcImagePlugin.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/test_file_iptc.py b/Tests/test_file_iptc.py index 8a7c59fb1..89c45d77b 100644 --- a/Tests/test_file_iptc.py +++ b/Tests/test_file_iptc.py @@ -28,7 +28,7 @@ def test_getiptcinfo_jpg_none() -> None: # Arrange with hopper() as im: # Act - iptc = IptcImagePlugin.getiptcinfo(im) + iptc = IptcImagePlugin.getiptcinfo(im) # type: ignore[arg-type] # Assert assert iptc is None diff --git a/src/PIL/IptcImagePlugin.py b/src/PIL/IptcImagePlugin.py index 7ca5e6680..a867cba77 100644 --- a/src/PIL/IptcImagePlugin.py +++ b/src/PIL/IptcImagePlugin.py @@ -192,7 +192,7 @@ Image.register_extension(IptcImageFile.format, ".iim") def getiptcinfo( - im: Image.Image, + im: ImageFile.ImageFile, ) -> dict[tuple[int, int], bytes | list[bytes]] | None: """ Get IPTC information from TIFF, JPEG, or IPTC file.