Changeset 31182 in osm for applications/editors/josm/plugins/mapillary/src/org
- Timestamp:
- 2015-06-02T16:21:50+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryExportWriterThread.java
r31176 r31182 11 11 import javax.imageio.ImageIO; 12 12 13 import org.apache.sanselan.ImageReadException; 14 import org.apache.sanselan.ImageWriteException; 15 import org.apache.sanselan.formats.jpeg.exifRewrite.ExifRewriter; 16 import org.apache.sanselan.formats.tiff.constants.GPSTagConstants; 17 import org.apache.sanselan.formats.tiff.constants.TagInfo; 18 import org.apache.sanselan.formats.tiff.constants.TiffDirectoryConstants; 19 import org.apache.sanselan.formats.tiff.constants.TiffFieldTypeConstants; 20 import org.apache.sanselan.formats.tiff.fieldtypes.FieldType; 21 import org.apache.sanselan.formats.tiff.write.TiffOutputDirectory; 22 import org.apache.sanselan.formats.tiff.write.TiffOutputField; 23 import org.apache.sanselan.formats.tiff.write.TiffOutputSet; 13 import org.apache.commons.imaging.ImageReadException; 14 import org.apache.commons.imaging.ImageWriteException; 15 import org.apache.commons.imaging.common.RationalNumber; 16 import org.apache.commons.imaging.formats.jpeg.exif.ExifRewriter; 17 import org.apache.commons.imaging.formats.tiff.constants.GpsTagConstants; 18 import org.apache.commons.imaging.formats.tiff.write.TiffOutputDirectory; 19 import org.apache.commons.imaging.formats.tiff.write.TiffOutputSet; 20 24 21 import org.openstreetmap.josm.Main; 25 22 import org.openstreetmap.josm.gui.progress.PleaseWaitProgressMonitor; … … 73 70 TiffOutputDirectory exifDirectory = outputSet 74 71 .getOrCreateGPSDirectory(); 75 FieldType fieldType = TiffFieldTypeConstants.FIELD_TYPE_RATIONAL; 76 TiffOutputField directionref = TiffOutputField.create( 77 GPSTagConstants.GPS_TAG_GPS_IMG_DIRECTION_REF, 78 outputSet.byteOrder, "T"); 79 exifDirectory.add(directionref); 80 TiffOutputField direction = TiffOutputField.create(new TagInfo( 81 "GPS Img Direction", 17, fieldType, 1, 82 TiffDirectoryConstants.EXIF_DIRECTORY_GPS), 83 outputSet.byteOrder, mimg.getCa()); 84 exifDirectory.add(direction); 85 try { 86 outputSet.setGPSInDegrees(mimg.getLatLon().lon(), mimg 87 .getLatLon().lat()); 88 } catch (ImageWriteException e) { 89 Main.error(e); 90 } 72 exifDirectory 73 .add(GpsTagConstants.GPS_TAG_GPS_IMG_DIRECTION_REF, 74 GpsTagConstants.GPS_TAG_GPS_IMG_DIRECTION_REF_VALUE_TRUE_NORTH); 75 exifDirectory.add(GpsTagConstants.GPS_TAG_GPS_IMG_DIRECTION, 76 RationalNumber.valueOf(mimg.getCa())); 77 outputSet.setGPSInDegrees(mimg.getLatLon().lon(), mimg 78 .getLatLon().lat()); 91 79 OutputStream os = new BufferedOutputStream( 92 80 new FileOutputStream(finalPath + ".jpg")); … … 99 87 } catch (IOException e) { 100 88 Main.error(e); 89 } catch (ImageWriteException e) { 90 // TODO Auto-generated catch block 91 e.printStackTrace(); 101 92 } catch (ImageReadException e) { 102 Main.error(e); 103 } catch (ImageWriteException e) { 104 Main.error(e); 93 // TODO Auto-generated catch block 94 e.printStackTrace(); 105 95 } 106 96
Note:
See TracChangeset
for help on using the changeset viewer.