Writing TIFF tags: improved BYTE, added UNDEFINED#4605
Merged
hugovk merged 3 commits intopython-pillow:masterfrom Jun 20, 2020
Merged
Writing TIFF tags: improved BYTE, added UNDEFINED#4605hugovk merged 3 commits intopython-pillow:masterfrom
hugovk merged 3 commits intopython-pillow:masterfrom
Conversation
6cd33e0 to
af5be32
Compare
Member
Author
|
I've added another commit to this PR, since they both involve the same code, to resolve #4252. Pillow has been just been skipping UNDEFINED tags when writing with libtiff. This commit adds writing of UNDEFINED tags. |
06f2a5d to
305bdc6
Compare
radarhere
added a commit
to radarhere/Pillow
that referenced
this pull request
Jun 21, 2020
Merged
radarhere
added a commit
to radarhere/Pillow
that referenced
this pull request
Jun 21, 2020
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 #3677
This PR has two changes.
Firstly, Pillow currently treats BYTE tags of count N as if they might have N strings. I do not believe this should be the case. To look at count values for character-related tags, the BYTE tag GPSAltitudeRef has count 1 for 1 character, the ASCII tag GPSDateStamp has count 11 for 11 characters, and the UNDEFINED tag Flashpix Version has count 4 for 4 characters. So, I think BYTE tags of count N have N characters, and are only single strings.
Secondly, this PR changes the following current code, to no longer force BYTE tags into ASCII tags.
Pillow/src/encode.c
Lines 732 to 736 in d23df72
This second change was made because in trying to resolve the issue, I found that libtiff was throwing an error for the XMLPACKET tag. It seems reasonable that it would - it is a BYTE tag, and we are instead passing ASCII.
Together, these changes resolve the issue.