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