Support writing LONG8 offsets in AppendingTiffWriter #8417
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pillow/Tests/test_file_tiff.py
Lines 110 to 116 in 3f24276
if you try and run the test without removing this tag, an error is raised from
AppendingTiffWriter
.Extending
AppendingTiffWriter
to handle LONG8 offsets is made complicated as it explicitly only handles shorts and longs, and has duplicated code to achieve that.Pillow/src/PIL/TiffImagePlugin.py
Lines 2143 to 2151 in 3f24276
Pillow/src/PIL/TiffImagePlugin.py
Lines 2153 to 2159 in 3f24276
Pillow/src/PIL/TiffImagePlugin.py
Lines 2198 to 2200 in 3f24276
Rather than just adding in
rewriteLastLong8()
,readLong8()
, and adding anisLong8
parameter, I've reworked the internals of the class to pass around the field size in my first commit. That made adding support for LONG8 very straightforward in my second commit.