update dict instead of ignoring

This commit is contained in:
Alexander 2020-01-19 14:48:01 +03:00
parent f55eb73934
commit dcd0cd9129

View File

@ -101,11 +101,9 @@ def APP(self, marker):
# markers appear in the correct sequence.
self.icclist.append(s)
elif marker == 0xFFED and s[:14] == b"Photoshop 3.0\x00":
# Process this marker only if previous were empty
if not self.info.get("photoshop"):
# parse the image resource block
offset = 14
photoshop = {}
photoshop = self.info.setdefault("photoshop", {})
while s[offset : offset + 4] == b"8BIM":
try:
offset += 4
@ -133,7 +131,6 @@ def APP(self, marker):
offset += offset & 1 # align
except struct.error:
break # no sufficient data
self.info["photoshop"] = photoshop
elif marker == 0xFFEE and s[:5] == b"Adobe":
self.info["adobe"] = i16(s, 5)