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

make description for 'GPSLatitude' and 'GPSLongitude' positive/negative #10

Closed
ghost opened this issue Oct 3, 2013 · 1 comment
Closed

Comments

@ghost
Copy link

ghost commented Oct 3, 2013

When sending coordinates to Google or Bing maps using a decimal latitude/longitude, they expect negative numbers if the coordinate is West or South. I'm working around this by testing the GPSLatitudeRef and GPSLongitudeRef and multiplying the description by -1 if the array returned by the Ref contains "W" or "S".

sign = exifReader.getTagValue('GPSLatitudeRef').indexOf('N') === -1 ? -1 : 1;
This would also work: sign = exifReader.getTagValue('GPSLatitudeRef').indexOf('N') || 1

@mattiasw
Copy link
Owner

I'm not sure that should be the responsibility of the library. The GPSLatitude and GPSLongitude tags don't have that kind of information. That's what the ref tags are for. Also, if the the corresponding ref tag is missing for some reason, the caller could get a faulty value (positive when it should be negative) and never know about it.

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

No branches or pull requests

1 participant