- Timestamp:
- 2006-07-08T00:25:28+02:00 (19 years ago)
- Location:
- src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/gui/layer/GeoImageLayer.java
r106 r107 124 124 125 125 ImageEntry e = new ImageEntry(); 126 e.time = ExifReader.readTime(f); 126 try { 127 e.time = ExifReader.readTime(f); 128 } catch (ParseException e1) { 129 continue; 130 } 127 131 if (e.time == null) 128 132 continue; … … 364 368 365 369 private void sync(File f) { 366 Date exifDate = ExifReader.readTime(f); 370 Date exifDate; 371 try { 372 exifDate = ExifReader.readTime(f); 373 } catch (ParseException e) { 374 JOptionPane.showMessageDialog(Main.parent, tr("The date in file \"{0}\" could not be parsed.", f.getName())); 375 return; 376 } 377 if (exifDate == null) { 378 JOptionPane.showMessageDialog(Main.parent, tr("There is no EXIF time within the file \"{0}\".", f.getName())); 379 return; 380 } 367 381 JPanel p = new JPanel(new GridBagLayout()); 368 382 p.add(new JLabel(tr("Image")), GBC.eol()); -
src/org/openstreetmap/josm/tools/DateParser.java
r106 r107 26 26 "MM/dd/yyyy'T'HH:mm:ssZ", 27 27 "MM/dd/yyyy'T'HH:mm:ss", 28 "yyyy:MM:dd HH:mm:ss", // unfcklvble, but I have seen this... 28 29 }; 29 30 -
src/org/openstreetmap/josm/tools/ExifReader.java
r104 r107 2 2 3 3 import java.io.File; 4 import java.text.ParseException; 4 5 import java.util.Date; 5 6 import java.util.Iterator; … … 16 17 public class ExifReader { 17 18 18 @SuppressWarnings("unchecked") public static Date readTime(File filename) { 19 @SuppressWarnings("unchecked") public static Date readTime(File filename) throws ParseException { 19 20 try { 20 21 Metadata metadata = JpegMetadataReader.readMetadata(filename); … … 26 27 } 27 28 } 29 } catch (ParseException e) { 30 throw e; 28 31 } catch (Exception e) { 29 32 e.printStackTrace();
Note:
See TracChangeset
for help on using the changeset viewer.