Skip to content

Commit

Permalink
add more data to error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Yay295 committed Oct 12, 2024
1 parent dc37515 commit 671d780
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions src/PIL/TiffImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2188,13 +2188,23 @@ def fixIFD(self) -> None:
if tag in self.Tags:
cur_pos = self.f.tell()

if is_local:
self._fixOffsets(count, field_size)
self.f.seek(cur_pos + 4)
else:
self.f.seek(offset)
self._fixOffsets(count, field_size)
self.f.seek(cur_pos)
try:
if is_local:
self._fixOffsets(count, field_size)
self.f.seek(cur_pos + 4)
else:
self.f.seek(offset)
self._fixOffsets(count, field_size)
self.f.seek(cur_pos)
except RuntimeError as e:
msg = (

Check warning on line 2200 in src/PIL/TiffImagePlugin.py

View check run for this annotation

Codecov / codecov/patch

src/PIL/TiffImagePlugin.py#L2199-L2200

Added lines #L2199 - L2200 were not covered by tests
f"{e}:"
f" Tag ID {tag}"
f" Field Type {field_type}"
f" Field Size {field_size}"
f" Count {count}"
)
raise RuntimeError(msg) from e

Check warning on line 2207 in src/PIL/TiffImagePlugin.py

View check run for this annotation

Codecov / codecov/patch

src/PIL/TiffImagePlugin.py#L2207

Added line #L2207 was not covered by tests

elif is_local:
# skip the locally stored value that is not an offset
Expand Down

0 comments on commit 671d780

Please sign in to comment.