Changeset 31182 in osm for applications/editors/josm/plugins
- Timestamp:
- 2015-06-02T16:21:50+02:00 (10 years ago)
- Location:
- applications/editors/josm/plugins/mapillary
- Files:
-
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mapillary/.classpath
r31176 r31182 5 5 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> 6 6 <classpathentry kind="lib" path="/home/nokutu/Dropbox/programacion/GSoC/josm/plugins/mapillary/lib/sanselan-0.97-incubator.jar"/> 7 <classpathentry kind="lib" path="/home/nokutu/.josm/plugins/commons-imaging.jar"/> 7 8 <classpathentry kind="output" path="bin"/> 8 9 </classpath> -
applications/editors/josm/plugins/mapillary/build.xml
r31175 r31182 30 30 <!-- <property name="plugin.link" value="..."/>--> 31 31 <!--<property name="plugin.early" value="..."/>--> 32 <!--<property name="plugin.requires" value=" ..."/>-->32 <!--<property name="plugin.requires" value="commons-imagery"/>--> 33 33 <!--<property name="plugin.stage" value="..."/>--> 34 34 … … 37 37 38 38 <!-- ** include targets that all plugins have in common ** --> 39 39 40 <import file="../build-common.xml"/> 40 41 42 <target name="compile" depends="init"> 43 <echo message="compiling sources for ${plugin.jar} ... "/> 44 <javac srcdir="src:../commons-imaging/src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}" includeantruntime="false"> 45 <classpath> 46 <pathelement location="${josm}"/> 47 48 </classpath> 49 <compilerarg value="-Xlint:deprecation"/> 50 <compilerarg value="-Xlint:unchecked"/> 51 </javac> 52 </target> 41 53 </project> -
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.