- Timestamp:
- 2018-08-31T23:25:33+02:00 (6 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/gpx
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/gpx/GpxImageEntry.java
r14209 r14210 6 6 import java.util.Date; 7 7 import java.util.Objects; 8 import java.util.function.Consumer; 8 9 9 10 import org.openstreetmap.josm.data.coor.CachedLatLon; … … 501 502 try { 502 503 if (dirExif != null) { 503 int orientation = dirExif.getInt(ExifIFD0Directory.TAG_ORIENTATION); 504 setExifOrientation(orientation); 504 setExifOrientation(dirExif.getInt(ExifIFD0Directory.TAG_ORIENTATION)); 505 505 } 506 506 } catch (MetadataException ex) { … … 511 511 if (dir != null) { 512 512 // there are cases where these do not match width and height stored in dirExif 513 int width = dir.getInt(JpegDirectory.TAG_IMAGE_WIDTH); 514 int height = dir.getInt(JpegDirectory.TAG_IMAGE_HEIGHT); 515 setWidth(width); 516 setHeight(height); 513 setWidth(dir.getInt(JpegDirectory.TAG_IMAGE_WIDTH)); 514 setHeight(dir.getInt(JpegDirectory.TAG_IMAGE_HEIGHT)); 517 515 } 518 516 } catch (MetadataException ex) { … … 526 524 } 527 525 528 final Double speed = ExifReader.readSpeed(dirGps); 529 if (speed != null) { 530 setSpeed(speed); 531 } 532 533 final Double ele = ExifReader.readElevation(dirGps); 534 if (ele != null) { 535 setElevation(ele); 536 } 537 538 try { 539 final LatLon latlon = ExifReader.readLatLon(dirGps); 540 setExifCoor(latlon); 526 ifNotNull(ExifReader.readSpeed(dirGps), this::setSpeed); 527 ifNotNull(ExifReader.readElevation(dirGps), this::setElevation); 528 529 try { 530 setExifCoor(ExifReader.readLatLon(dirGps)); 541 531 setPos(getExifCoor()); 542 532 } catch (MetadataException | IndexOutOfBoundsException ex) { // (other exceptions, e.g. #5271) … … 547 537 548 538 try { 549 final Double direction = ExifReader.readDirection(dirGps); 550 if (direction != null) { 551 setExifImgDir(direction); 552 } 539 ifNotNull(ExifReader.readDirection(dirGps), this::setExifImgDir); 553 540 } catch (IndexOutOfBoundsException ex) { // (other exceptions, e.g. #5271) 554 541 Logging.debug(ex); 555 542 } 556 543 557 final Date gpsDate = dirGps.getGpsDate(); 558 if (gpsDate != null) { 559 setExifGpsTime(gpsDate); 544 ifNotNull(dirGps.getGpsDate(), this::setExifGpsTime); 545 } 546 547 private static <T> void ifNotNull(T value, Consumer<T> setter) { 548 if (value != null) { 549 setter.accept(value); 560 550 } 561 551 } -
trunk/src/org/openstreetmap/josm/data/gpx/GpxTimezone.java
r14205 r14210 45 45 StringBuilder ret = new StringBuilder(); 46 46 47 double t imezone= this.timezone;48 if (t imezone< 0) {47 double tz = this.timezone; 48 if (tz < 0) { 49 49 ret.append('-'); 50 t imezone = -timezone;50 tz = -tz; 51 51 } else { 52 52 ret.append('+'); 53 53 } 54 ret.append((long) t imezone).append(':');55 int minutes = (int) ((t imezone% 1) * 60);54 ret.append((long) tz).append(':'); 55 int minutes = (int) ((tz % 1) * 60); 56 56 if (minutes < 10) { 57 57 ret.append('0');
Note:
See TracChangeset
for help on using the changeset viewer.