Changeset 18315 in josm
- Timestamp:
- 2021-11-07T15:01:40+01:00 (3 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/gpx/GpxImageEntry.java
r18252 r18315 732 732 733 733 try { 734 if (dirExif != null ) {734 if (dirExif != null && dirExif.containsTag(ExifIFD0Directory.TAG_ORIENTATION)) { 735 735 setExifOrientation(dirExif.getInt(ExifIFD0Directory.TAG_ORIENTATION)); 736 736 } … … 740 740 741 741 try { 742 if (dir != null ) {742 if (dir != null && dir.containsTag(JpegDirectory.TAG_IMAGE_WIDTH) && dir.containsTag(JpegDirectory.TAG_IMAGE_HEIGHT)) { 743 743 // there are cases where these do not match width and height stored in dirExif 744 744 setWidth(dir.getInt(JpegDirectory.TAG_IMAGE_WIDTH)); -
trunk/src/org/openstreetmap/josm/tools/ExifReader.java
r18014 r18315 177 177 */ 178 178 public static LatLon readLatLon(GpsDirectory dirGps) throws MetadataException { 179 if (dirGps != null && dirGps. getTagCount() > 1) {179 if (dirGps != null && dirGps.containsTag(GpsDirectory.TAG_LATITUDE) && dirGps.containsTag(GpsDirectory.TAG_LONGITUDE)) { 180 180 double lat = readAxis(dirGps, GpsDirectory.TAG_LATITUDE, GpsDirectory.TAG_LATITUDE_REF, 'S'); 181 181 double lon = readAxis(dirGps, GpsDirectory.TAG_LONGITUDE, GpsDirectory.TAG_LONGITUDE_REF, 'W'); … … 297 297 public static Double readElevation(File filename) { 298 298 try { 299 final Metadata metadata = JpegMetadataReader.readMetadata(filename); 300 final GpsDirectory dirGps = metadata.getFirstDirectoryOfType(GpsDirectory.class); 301 return readElevation(dirGps); 299 return readElevation(JpegMetadataReader.readMetadata(filename).getFirstDirectoryOfType(GpsDirectory.class)); 302 300 } catch (JpegProcessingException | IOException e) { 303 301 Logging.error(e); 304 }305 return null;302 return null; 303 } 306 304 } 307 305
Note:
See TracChangeset
for help on using the changeset viewer.