-
I've run into a problem where exif gps info from ios devices. The [seconds] rational (from ExifTag.GPSLongitude array) is always 0. It works ok with android and other images. Here's what i'm trying to do: `internal static ExifGPSCoordinates GetGPSCoordinates(IExifProfile exifProfile)
` Ive attached a sample ios image for testing. You can check the metadata on https://www.pic2map.com/ which shows the coordinates to be 45° 30' 42.30" N , 122° 39' 56.38" W. However, in the code above, the value in the [seconds] rational is 0. Is this a bug or should I be parsing GPSLongitude and GPSLatitude out differently? Thanks in advance for your help |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Just noticed that you are doing the conversion to |
Beta Was this translation helpful? Give feedback.
-
I got the correct result with the following calucation: var value = profile.GetValue(ExifTag.GPSLongitude);
var degrees = value.Value[0].ToDouble();
var minutes = value.Value[1].ToDouble();
var seconds = value.Value[2].ToDouble();
minutes += 60 * (degrees - Math.Floor(degrees));
degrees = Math.Floor(degrees);
seconds += 60 * (minutes - Math.Floor(minutes));
minutes = Math.Floor(minutes);
var pos = $"{degrees} {minutes} {seconds}"; Did not check how to do negative values based on the |
Beta Was this translation helpful? Give feedback.
I got the correct result with the following calucation:
Did not check how to do negative values based on the
LatitudeRef