Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tiff: ignore all trailing NULLs in case of misleading Count
As it can apparently happen with some camera software (https://user-images.githubusercontent.com/2621/39392188-71a66fc4-4a66-11e8-9e3b-694163efa643.jpg), sometimes a tag bytes will not only have a bunch of trailing NULLs, but the Count for the data in that tag will be wrongly set too. i.e. instead of being set to the actual number of relevant bytes to read, it will be set to the full number of bytes, trailing zeroes included. As a consequence, the Tag.strVal returned would include these trailing NULLs too, which would lead to bugs such as perkeep/perkeep#1127 This change therefore makes sure to remove all trailing NULLs from the data, in the case of DTAscii at least.
- Loading branch information
Showing
2 changed files
with
25 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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