- Timestamp:
- 2017-01-30T23:21:38+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/ExifReader.java
r11484 r11514 44 44 Metadata metadata = JpegMetadataReader.readMetadata(filename); 45 45 String dateStr = null; 46 String dateTime = null; 46 47 String subSeconds = null; 47 48 for (Directory dirIt : metadata.getDirectories()) { … … 52 53 if (tag.getTagType() == ExifSubIFDDirectory.TAG_DATETIME_ORIGINAL /* 0x9003 */ && 53 54 !tag.getDescription().matches("\\[[0-9]+ .+\\]")) { 55 // prefer DATETIME_ORIGINAL 54 56 dateStr = tag.getDescription(); 55 57 } 56 if (tag.getTagType() == ExifIFD0Directory.TAG_DATETIME /* 0x0132 */ ||57 tag.getTagType() == ExifSubIFDDirectory.TAG_DATETIME_DIGITIZED /* 0x9004 */) {58 if (dateStr == null) {59 // prefer TAG_DATETIME_ORIGINAL60 dateStr = tag.getDescription();61 }58 if (tag.getTagType() == ExifIFD0Directory.TAG_DATETIME /* 0x0132 */) { 59 // prefer DATETIME over DATETIME_DIGITIZED 60 dateTime = tag.getDescription(); 61 } 62 if (tag.getTagType() == ExifSubIFDDirectory.TAG_DATETIME_DIGITIZED /* 0x9004 */ && dateTime == null) { 63 dateTime = tag.getDescription(); 62 64 } 63 65 if (tag.getTagType() == ExifIFD0Directory.TAG_SUBSECOND_TIME_ORIGINAL) { … … 65 67 } 66 68 } 69 } 70 if (dateStr == null) { 71 dateStr = dateTime; 67 72 } 68 73 if (dateStr != null) {
Note:
See TracChangeset
for help on using the changeset viewer.