Changeset 19101 in josm for trunk/src/org/openstreetmap/josm/tools/ExifReader.java
- Timestamp:
- 2024-06-11T23:53:20+02:00 (5 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/ExifReader.java
r18315 r19101 23 23 import com.drew.metadata.exif.ExifDirectoryBase; 24 24 import com.drew.metadata.exif.ExifIFD0Directory; 25 import com.drew.metadata.exif.ExifSubIFDDirectory;26 25 import com.drew.metadata.exif.GpsDirectory; 27 26 import com.drew.metadata.iptc.IptcDirectory; … … 76 75 } 77 76 for (Tag tag : dirIt.getTags()) { 78 if (tag.getTagType() == Exif SubIFDDirectory.TAG_DATETIME_ORIGINAL /* 0x9003 */ &&79 !tag.getDescription().matches("\\[ [0-9]+ .+\\]")) {77 if (tag.getTagType() == ExifDirectoryBase.TAG_DATETIME_ORIGINAL /* 0x9003 */ && 78 !tag.getDescription().matches("\\[\\d+ .+]")) { 80 79 dateTimeOrig = tag.getDescription(); 81 } else if (tag.getTagType() == Exif IFD0Directory.TAG_DATETIME /* 0x0132 */) {80 } else if (tag.getTagType() == ExifDirectoryBase.TAG_DATETIME /* 0x0132 */) { 82 81 dateTime = tag.getDescription(); 83 } else if (tag.getTagType() == Exif SubIFDDirectory.TAG_DATETIME_DIGITIZED /* 0x9004 */) {82 } else if (tag.getTagType() == ExifDirectoryBase.TAG_DATETIME_DIGITIZED /* 0x9004 */) { 84 83 dateTimeDig = tag.getDescription(); 85 } else if (tag.getTagType() == Exif SubIFDDirectory.TAG_SUBSECOND_TIME_ORIGINAL /* 0x9291 */) {84 } else if (tag.getTagType() == ExifDirectoryBase.TAG_SUBSECOND_TIME_ORIGINAL /* 0x9291 */) { 86 85 subSecOrig = tag.getDescription(); 87 } else if (tag.getTagType() == Exif SubIFDDirectory.TAG_SUBSECOND_TIME /* 0x9290 */) {86 } else if (tag.getTagType() == ExifDirectoryBase.TAG_SUBSECOND_TIME /* 0x9290 */) { 88 87 subSec = tag.getDescription(); 89 } else if (tag.getTagType() == Exif SubIFDDirectory.TAG_SUBSECOND_TIME_DIGITIZED /* 0x9292 */) {88 } else if (tag.getTagType() == ExifDirectoryBase.TAG_SUBSECOND_TIME_DIGITIZED /* 0x9292 */) { 90 89 subSecDig = tag.getDescription(); 91 90 } … … 145 144 final Metadata metadata = JpegMetadataReader.readMetadata(filename); 146 145 final Directory dir = metadata.getFirstDirectoryOfType(ExifIFD0Directory.class); 147 return dir == null ? null : dir.getInteger(Exif IFD0Directory.TAG_ORIENTATION);146 return dir == null ? null : dir.getInteger(ExifDirectoryBase.TAG_ORIENTATION); 148 147 } catch (JpegProcessingException | IOException e) { 149 148 Logging.error(e); … … 316 315 if (ele != null) { 317 316 final Integer d = dirGps.getInteger(GpsDirectory.TAG_ALTITUDE_REF); 318 if (d != null && d .intValue()== 1) {317 if (d != null && d == 1) { 319 318 ele *= -1; 320 319 } … … 367 366 /** 368 367 * Returns a Transform that fixes the image orientation. 369 * 368 * <p> 370 369 * Only orientation 1, 3, 6 and 8 are supported. Everything else is treated as 1. 371 370 * @param orientation the exif-orientation of the image … … 376 375 public static AffineTransform getRestoreOrientationTransform(final int orientation, final int width, final int height) { 377 376 final int q; 378 final double ax, ay; 377 final double ax; 378 final double ay; 379 379 switch (orientation) { 380 380 case 8: … … 404 404 * Check, if the given orientation switches width and height of the image. 405 405 * E.g. 90 degree rotation 406 * 406 * <p> 407 407 * Only orientation 1, 3, 6 and 8 are supported. Everything else is treated 408 408 * as 1. … … 416 416 /** 417 417 * Check, if the given orientation requires any correction to the image. 418 * 418 * <p> 419 419 * Only orientation 1, 3, 6 and 8 are supported. Everything else is treated 420 420 * as 1.
Note:
See TracChangeset
for help on using the changeset viewer.