Changeset 3365 in josm for trunk/src/org
- Timestamp:
- 2010-07-07T19:18:19+02:00 (14 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
r3310 r3365 517 517 private static void extractExif(ImageEntry e) { 518 518 519 int deg; 520 double min, sec; 521 double lon, lat; 522 Metadata metadata = null; 523 Directory dir = null; 524 519 525 try { 520 int deg; 521 double min, sec; 522 double lon, lat; 523 524 Metadata metadata = JpegMetadataReader.readMetadata(e.getFile()); 525 Directory dir = metadata.getDirectory(GpsDirectory.class); 526 526 metadata = JpegMetadataReader.readMetadata(e.getFile()); 527 dir = metadata.getDirectory(GpsDirectory.class); 528 } catch (CompoundException p) { 529 e.setExifCoor(null); 530 e.setPos(null); 531 return; 532 } 533 534 try { 527 535 // longitude 528 536 … … 553 561 } 554 562 555 556 // compass direction value557 558 Rational direction = null;559 560 try {561 direction = dir.getRational(GpsDirectory.TAG_GPS_IMG_DIRECTION);562 } catch (CompoundException p) {563 direction = null;564 }565 566 563 // Store values 567 564 568 565 e.setExifCoor(new LatLon(lat, lon)); 569 566 e.setPos(e.getExifCoor()); 570 if (direction != null) {571 e.setExifImgDir(direction.doubleValue());572 }573 567 574 568 } catch (CompoundException p) { 575 e.setExifCoor(null); 576 e.setPos(null); 577 } 569 // Try to read lon/lat as double value (Nonstandard, created by some cameras -> #5220) 570 try { 571 Double longitude = dir.getDouble(GpsDirectory.TAG_GPS_LONGITUDE); 572 Double latitude = dir.getDouble(GpsDirectory.TAG_GPS_LATITUDE); 573 if (longitude == null || latitude == null) 574 throw new CompoundException(""); 575 576 // Store values 577 578 e.setExifCoor(new LatLon(latitude, longitude)); 579 e.setPos(e.getExifCoor()); 580 } catch (CompoundException ex) { 581 e.setExifCoor(null); 582 e.setPos(null); 583 } 584 } 585 586 // compass direction value 587 588 Rational direction = null; 589 590 try { 591 direction = dir.getRational(GpsDirectory.TAG_GPS_IMG_DIRECTION); 592 } catch (CompoundException p) { 593 direction = null; 594 } 595 if (direction != null) { 596 e.setExifImgDir(direction.doubleValue()); 597 } 598 578 599 } 579 600 … … 605 626 606 627 public void checkPreviousNextButtons() { 607 // System.err.println("showing image " + currentPhoto);608 628 ImageViewerDialog.setNextEnabled(currentPhoto < data.size() - 1); 609 629 ImageViewerDialog.setPreviousEnabled(currentPhoto > 0); -
trunk/src/org/openstreetmap/josm/io/OsmApi.java
r3336 r3365 204 204 osmWriter.footer(); 205 205 osmWriter.out.flush(); 206 return swriter.toString(); 206 String s = swriter.toString(); 207 System.err.println("OsmApi/toXml:\n"+s+"_|"); 208 return s; 207 209 } 208 210 -
trunk/src/org/openstreetmap/josm/io/OsmChangeBuilder.java
r3083 r3365 130 130 131 131 public String getDocument() { 132 return swriter.toString(); 132 String s = swriter.toString(); 133 System.err.println("OsmChangeBuilder/getDocument:\n"+s+"_|"); 134 return s; 133 135 } 134 136 } -
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r2990 r3365 88 88 /** 89 89 * Like {@link #get(String)}, but does not throw and return <code>null</code> in case of nothing 90 * is found. Use this, if the image to retrieve is optional. 90 * is found. Use this, if the image to retrieve is optional. Nevertheless a warning will 91 * be printed on the console if the image could not be found. 91 92 */ 92 93 public static ImageIcon getIfAvailable(Collection<String> dirs, String id, String subdir, String name) { … … 94 95 } 95 96 97 /** 98 * The full path of the image is either a url (starting with http://) 99 * or something like 100 * dirs.get(i)+"/"+subdir+"/"+name+".png". 101 * @param dirs Directories to look. 102 * @param id An id used for caching. Id is not used for cache if name starts with http://. (URL is unique anyway.) 103 * @param subdir Subdirectory the image lies in. 104 * @param name The name of the image. If it contains no '.', a png extension is added. 105 * @param archive A zip file where the image is located. 106 */ 96 107 public static ImageIcon getIfAvailable(Collection<String> dirs, String id, String subdir, String name, File archive) { 97 108 if (name == null)
Note:
See TracChangeset
for help on using the changeset viewer.