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

Exiv2 returns "binary data" for valid content in Exif.Photo.UserComment #1431

Closed
ghost opened this issue Dec 11, 2020 · 2 comments · Fixed by #1432
Closed

Exiv2 returns "binary data" for valid content in Exif.Photo.UserComment #1431

ghost opened this issue Dec 11, 2020 · 2 comments · Fixed by #1432
Assignees
Labels
Milestone

Comments

@ghost
Copy link

ghost commented Dec 11, 2020

In Exiv2.0.27.3, source file value.cpp, function CommentValue::comment was changed. The modification targets to identify invalid binary data in a comment field with “Undefined” character code.
Yet, the implementation creates new problems. So, now just content encoded 7-bit ASCII in the character range 32-127 will be allowed.
Most (if not all) of the regional Windows or other ASCII codepages allow for special characters for their related cultures, represented in the character range 128-255. The Exif Specifications JEITA CP-3451 Exif2-2.PDF Table 7 do not restrict content to 7-Bit ASCII. On the contrary, for “Undefined” character code, it allows for regional settings, says “Depends on the localized PC in each country”, … “although the possibility of unreadable characters exist”.
Clearly, ASCII encoding in any codepage will not allow for intercultural exchange, if the encoding codepage is not known. But reducing allowed content to 7-Bit ASCII cannot be the solution.

There is another problem with the function: The subroutine “isBinary” which is used by CommentValue::comment causes problems, even if the “undefined” comment is 7-Bit ASCII encoded:
In case the encoding program (in this case Canon ZoomBrowser EX) writes a buffer to the field, where the rest of the buffer behind the string is properly filled with low-value, “isBinary” returns “true” as soon as it hits on the low-value in the loop over the string buffer with the consequence, the field is marked “binary comment” .

Suggestion: remove modifications in CommentValue::comment and, where “invalid input” might have caused problems, e.g. in print functions, as indicated in a comment referring to non-printable bytes, handle possible problems there (e.g. just replacing control characters or what else might be undesired in output formatting, but retaining the data). The program or routine that obtains the data from the library should deal with possible "non-printable" bytes when printing, if there are any ...

Thanks!

@ghost ghost added the bug label Dec 11, 2020
@clanmills clanmills self-assigned this Dec 11, 2020
@clanmills clanmills added this to the v0.27.4 milestone Dec 11, 2020
@clanmills
Copy link
Collaborator

Thanks for reporting this. Can you provide a file which has been modified by Canon ZoomBrowser EX in the way you describe, please?

You are not the first to have complained about this and it will get attention on the 0.27-maintenance branch. After I retire on 2021-01-18, the future of Exiv2 is out of my hands. At the moment, nobody has expressed any interest in becoming the maintainer. While this is a disappointment to me, the community is mistaken if they think I will continue to work on Exiv2. https://discuss.pixls.us/t/maintainer-urgently-needed-for-exiv2/21547/8

I am writing a book Image Metadata and Exiv2 Architecture https://clanmills.com/exiv2/book/

I leave Exiv2 with no open issues on the 0.27-maintenance branch. No security issue has been reported in 2020. The number of contributors is steadily increasing, the code is robust. We have excellent documentation and a solid release process. I am willing to support and mentor anyone who volunteers.

@clanmills
Copy link
Collaborator

Fix submitted: #1432. I have explain in the PR the change and reasoning. If you wish to discuss further, please do so in #1432.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant