From 94839ec99a21067346c7b1b03e6572d71f99310b Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sun, 31 Dec 2023 21:52:08 +1100 Subject: [PATCH] Changed tile tuple to match other plugins --- src/PIL/IptcImagePlugin.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/PIL/IptcImagePlugin.py b/src/PIL/IptcImagePlugin.py index e7dc3e4e4d2..09a60f25c40 100644 --- a/src/PIL/IptcImagePlugin.py +++ b/src/PIL/IptcImagePlugin.py @@ -128,24 +128,20 @@ def _open(self): # tile if tag == (8, 10): - self.tile = [ - ("iptc", (compression, offset), (0, 0, self.size[0], self.size[1])) - ] + self.tile = [("iptc", (0, 0) + self.size, offset, compression)] def load(self): if len(self.tile) != 1 or self.tile[0][0] != "iptc": return ImageFile.ImageFile.load(self) - type, tile, box = self.tile[0] - - encoding, offset = tile + offset, compression = self.tile[0][2:] self.fp.seek(offset) # Copy image data to temporary file o_fd, outfile = tempfile.mkstemp(text=False) o = os.fdopen(o_fd) - if encoding == "raw": + if compression == "raw": # To simplify access to the extracted file, # prepend a PPM header o.write("P5\n%d %d\n255\n" % self.size)