Updated libtiff to 4.2.0#5153
Merged
radarhere merged 2 commits intopython-pillow:masterfrom Dec 30, 2020
Merged
Conversation
4178ddc to
8dd5913
Compare
hugovk
approved these changes
Dec 30, 2020
This was referenced Mar 8, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Resolves #5157
Updated libtiff to 4.2.0, adding a setting to 'winbuild/tiff.opt' because of https://gitlab.com/libtiff/libtiff/-/commit/58b16f47a82323c05ec81f0a821700beb8c2c5a0 (later simplified).
However, from the first commit here, you can see that a test fails.
Investigating, it is failing specifically because of
Pillow/Tests/test_file_libtiff.py
Line 256 in 18ee51a
libtiff 4.2.0 added the 'Rational2Double' block in this code (if you're interested, it was part of https://gitlab.com/Su_Laus/libtiff/-/commit/6df997c786928757caea0dd68d26ea5f098f49df) -
These lines are returning zero for
tv_size- I conclude it is becausefip->set_field_typeis not properly set from https://gitlab.com/libtiff/libtiff/-/blob/v4.2.0/libtiff/tif_dirinfo.c#L1106-1109 inTIFFMergeFieldInfo.This is because
_TIFFSetGetTypehas a few conditions to match againstTIFF_RATIONAL-but none involve
count(readcountin TiffDecode.c) being zero.Pillow/src/libImaging/TiffDecode.c
Line 581 in 18ee51a
So this PR changes that value, and the test now passes.
This also then fixes python-pillow/pillow-wheels#180.