Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more data to error message #8316

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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
Loading