Open
Conversation
Due to some HEIC file converters to JPG longitude and latitude strings gets converted from UNICODE with wrong UTF-8 coding. e.g. North "N" have hex bytes hex:4e ef bf bd
For that reason latitudeRef.trim().equalsIgnoreCase("n") fails. My suggestion is to use substring(0, 1) instead of trim()
Member
|
This doesn't look right to me and will break existing applications that have leading or trailing whitespace in that data. Are you saying that some other app is creating bad data? |
Author
|
Well, if it'so we can insert a trim() just before substring(). For the
sake of completness I've used paintshop-pro to convert heic file to jpg.
Il Mer 14 Mag 2025, 18:27 Gary Gregory ***@***.***> ha
scritto:
… *garydgregory* left a comment (apache/commons-imaging#507)
<#507 (comment)>
This doesn't look right to me and will break existing applications that
have leading or trailing whitespace in that data.
Are you saying that some other app is creating bad data?
—
Reply to this email directly, view it on GitHub
<#507 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAYDPUU6JGTELTDU7YJRWRL26NVHBAVCNFSM6AAAAAB5DYTRCSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQOBQHA2DSMZTGI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Member
|
Hello @clagenna
Does the data start bad in the HEIC file? Does PSP create a bad file? Can you provide a unit test with each file that demonstrates the issue? Ideally the test should fail if the changes to 'main' aren't applied. Ty. |
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.
Due to some HEIC file converters to JPG longitude and latitude strings gets converted from UNICODE with wrong UTF-8 coding. e.g. North "N" have hex bytes hex:4e ef bf bd For that reason latitudeRef.trim().equalsIgnoreCase("n") fails. My suggestion is to use substring(0, 1) instead of trim()
Thanks for your contribution to Apache Commons! Your help is appreciated!
Before you push a pull request, review this list:
mvn; that'smvnon the command line by itself.