Codec is always "iptc"

This commit is contained in:
Andrew Murray 2025-07-12 12:47:54 +10:00
parent bc2519abf1
commit 68ac3375c6

View File

@ -124,9 +124,7 @@ class IptcImageFile(ImageFile.ImageFile):
]
def load(self) -> Image.core.PixelAccess | None:
if len(self.tile) != 1 or self.tile[0][0] != "iptc":
return ImageFile.ImageFile.load(self)
if self.tile:
offset, compression = self.tile[0][2:]
self.fp.seek(offset)
@ -152,7 +150,7 @@ class IptcImageFile(ImageFile.ImageFile):
_im.load()
self.im = _im.im
self.tile = []
return Image.Image.load(self)
return ImageFile.ImageFile.load(self)
Image.register_open(IptcImageFile.format, IptcImageFile)