Changeset 31496 in osm for applications
- Timestamp:
- 2015-08-13T00:07:18+02:00 (9 years ago)
- Location:
- applications/editors/josm/plugins/mapillary
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mapillary/build.xml
r31493 r31496 5 5 <property name="plugin.main.version" value="8433"/> 6 6 <property name="plugin.canloadatruntime" value="true"/> 7 <property name="plugin.version" value="0.9. 3"/>7 <property name="plugin.version" value="0.9.4"/> 8 8 <property name="plugin.author" value="nokutu <nokutu@openmailbox.org>"/> 9 9 <property name="plugin.class" value="org.openstreetmap.josm.plugins.mapillary.MapillaryPlugin"/> -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryAbstractImage.java
r31460 r31496 235 235 * The format of the date. 236 236 * @return The date in Epoch format. 237 */ 238 public static long getEpoch(String date, String format) { 237 * @throws ParseException 238 */ 239 public static long getEpoch(String date, String format) throws ParseException { 239 240 240 241 SimpleDateFormat formatter = new SimpleDateFormat(format); 241 try { 242 Date dateTime = formatter.parse(date); 243 return dateTime.getTime(); 244 } catch (ParseException e) { 245 Main.error(e); 246 } 247 return currentTime(); 242 Date dateTime = formatter.parse(date); 243 return dateTime.getTime(); 244 248 245 } 249 246 … … 253 250 * @return The current date in Epoch format. 254 251 */ 255 pr ivatestatic long currentTime() {252 protected static long currentTime() { 256 253 Calendar cal = Calendar.getInstance(); 257 254 return cal.getTimeInMillis(); -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryImportedImage.java
r31458 r31496 4 4 import java.io.File; 5 5 import java.io.IOException; 6 import java.text.ParseException; 6 7 import java.text.SimpleDateFormat; 7 8 import java.util.Calendar; … … 20 21 protected File file; 21 22 /** The date when the picture was taken. */ 22 public finallong datetimeOriginal;23 public long datetimeOriginal; 23 24 24 25 /** … … 57 58 super(lat, lon, ca); 58 59 this.file = file; 59 this.datetimeOriginal = getEpoch(datetimeOriginal, "yyyy:MM:dd hh:mm:ss"); 60 try { 61 this.datetimeOriginal = getEpoch(datetimeOriginal, "yyyy:MM:dd hh:mm:ss"); 62 } catch (ParseException e) { 63 try { 64 this.datetimeOriginal = getEpoch(datetimeOriginal, 65 "yyyy/MM/dd hh:mm:ss"); 66 } catch (ParseException e1) { 67 this.datetimeOriginal = currentTime(); 68 } 69 } 60 70 } 61 71 -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/oauth/UploadUtils.java
r31491 r31496 26 26 import org.apache.commons.imaging.formats.tiff.constants.ExifTagConstants; 27 27 import org.apache.commons.imaging.formats.tiff.constants.GpsTagConstants; 28 import org.apache.commons.imaging.formats.tiff.constants.TiffTagConstants; 28 29 import org.apache.commons.imaging.formats.tiff.write.TiffOutputDirectory; 29 30 import org.apache.commons.imaging.formats.tiff.write.TiffOutputSet; … … 188 189 Main.error(e); 189 190 } 190 System.out.println(this.images.size());191 191 if (this.delete) 192 MapillaryRecord.getInstance().addCommand(new CommandDelete(this.images)); 192 MapillaryRecord.getInstance() 193 .addCommand(new CommandDelete(this.images)); 193 194 } 194 195 } … … 230 231 TiffOutputDirectory exifDirectory = null; 231 232 TiffOutputDirectory gpsDirectory = null; 233 TiffOutputDirectory rootDirectory = null; 234 232 235 // If the image is imported, loads the rest of the EXIF data. 233 236 JpegImageMetadata jpegMetadata = null; … … 248 251 gpsDirectory = outputSet.getOrCreateGPSDirectory(); 249 252 exifDirectory = outputSet.getOrCreateExifDirectory(); 253 rootDirectory = outputSet.getOrCreateRootDirectory(); 250 254 251 255 gpsDirectory.removeField(GpsTagConstants.GPS_TAG_GPS_IMG_DIRECTION_REF); … … 260 264 exifDirectory.add(ExifTagConstants.EXIF_TAG_DATE_TIME_ORIGINAL, 261 265 ((MapillaryImportedImage) image).getDate("yyyy/MM/dd hh:mm:ss")); 266 267 rootDirectory.removeField(TiffTagConstants.TIFF_TAG_IMAGE_DESCRIPTION); 262 268 263 269 outputSet.setGPSInDegrees(image.getLatLon().lon(), image.getLatLon().lat());
Note:
See TracChangeset
for help on using the changeset viewer.