X-Git-Url: https://gitweb.fperrin.net/?p=GpsPrune.git;a=blobdiff_plain;f=tim%2Fprune%2Fjpeg%2FExternalExifLibrary.java;h=cff2346e531dff458d4b91a1a49822a270087d51;hp=1c64b4e247fcd83ba4632050667a61fe09c1c5c3;hb=f35b6d628f68e3b5ef19965ad8988d0dd1eb8efa;hpb=3745d70b1427bb8ac1a085e47cbdc566936784e1 diff --git a/tim/prune/jpeg/ExternalExifLibrary.java b/tim/prune/jpeg/ExternalExifLibrary.java index 1c64b4e..cff2346 100644 --- a/tim/prune/jpeg/ExternalExifLibrary.java +++ b/tim/prune/jpeg/ExternalExifLibrary.java @@ -42,12 +42,14 @@ public class ExternalExifLibrary implements ExifLibrary { data.setLatitudeRef(gpsdir.getString(GpsDirectory.TAG_GPS_LATITUDE_REF)); Rational[] latRats = gpsdir.getRationalArray(GpsDirectory.TAG_GPS_LATITUDE); + double seconds = ExifGateway.convertToPositiveValue(latRats[2].getNumerator(), latRats[2].getDenominator()); data.setLatitude(new double[] {latRats[0].doubleValue(), - latRats[1].doubleValue(), latRats[2].doubleValue()}); + latRats[1].doubleValue(), seconds}); data.setLongitudeRef(gpsdir.getString(GpsDirectory.TAG_GPS_LONGITUDE_REF)); Rational[] lonRats = gpsdir.getRationalArray(GpsDirectory.TAG_GPS_LONGITUDE); + seconds = ExifGateway.convertToPositiveValue(lonRats[2].getNumerator(), lonRats[2].getDenominator()); data.setLongitude(new double[] {lonRats[0].doubleValue(), - lonRats[1].doubleValue(), lonRats[2].doubleValue()}); + lonRats[1].doubleValue(), seconds}); } // Altitude (if present) @@ -110,6 +112,7 @@ public class ExternalExifLibrary implements ExifLibrary return data; } + /** * Check whether the exifreader class can be correctly resolved * @return true if it looks ok