Ticket #6162: geoimage.2.patch
| File geoimage.2.patch, 2.9 KB (added by , 15 years ago) |
|---|
-
core/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
46 46 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor; 47 47 import org.openstreetmap.josm.gui.ExtendedDialog; 48 48 import org.openstreetmap.josm.gui.MapFrame; 49 import org.openstreetmap.josm.gui.MapFrame.MapModeChangeListener; 49 50 import org.openstreetmap.josm.gui.MapView; 51 import org.openstreetmap.josm.gui.MapView.LayerChangeListener; 50 52 import org.openstreetmap.josm.gui.PleaseWaitRunnable; 51 import org.openstreetmap.josm.gui.MapFrame.MapModeChangeListener;52 import org.openstreetmap.josm.gui.MapView.LayerChangeListener;53 53 import org.openstreetmap.josm.gui.dialogs.LayerListDialog; 54 54 import org.openstreetmap.josm.gui.dialogs.LayerListPopup; 55 55 import org.openstreetmap.josm.gui.layer.GpxLayer; … … 504 504 505 505 private static void extractExif(ImageEntry e) { 506 506 507 intdeg;507 double deg; 508 508 double min, sec; 509 509 double lon, lat; 510 510 Metadata metadata = null; … … 524 524 525 525 Rational[] components = dir.getRationalArray(GpsDirectory.TAG_GPS_LONGITUDE); 526 526 527 deg = components[0]. intValue();528 min = components[1]. floatValue();529 sec = components[2]. floatValue();527 deg = components[0].doubleValue(); 528 min = components[1].doubleValue(); 529 sec = components[2].doubleValue(); 530 530 531 lon = (deg + (min / 60) + (sec / 3600)); 532 533 if (Double.isNaN(lon)) 531 if (Double.isNaN(deg) && Double.isNaN(min) && Double.isNaN(sec)) 534 532 throw new IllegalArgumentException(); 535 533 534 lon = (Double.isNaN(deg) ? 0 : deg + (Double.isNaN(min) ? 0 : (min / 60)) + (Double.isNaN(sec) ? 0 : (sec / 3600))); 535 536 536 if (dir.getString(GpsDirectory.TAG_GPS_LONGITUDE_REF).charAt(0) == 'W') { 537 537 lon = -lon; 538 538 } … … 541 541 542 542 components = dir.getRationalArray(GpsDirectory.TAG_GPS_LATITUDE); 543 543 544 deg = components[0]. intValue();545 min = components[1]. floatValue();546 sec = components[2]. floatValue();544 deg = components[0].doubleValue(); 545 min = components[1].doubleValue(); 546 sec = components[2].doubleValue(); 547 547 548 lat = (deg + (min / 60) + (sec / 3600)); 548 if (Double.isNaN(deg) && Double.isNaN(min) && Double.isNaN(sec)) 549 throw new IllegalArgumentException(); 549 550 551 lat = (Double.isNaN(deg) ? 0 : deg + (Double.isNaN(min) ? 0 : (min / 60)) + (Double.isNaN(sec) ? 0 : (sec / 3600))); 552 550 553 if (Double.isNaN(lat)) 551 554 throw new IllegalArgumentException(); 552 555
