﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
11757	"""APP1 Segment is too long"" when using ""write coordinates to image headers"""	mmyfl	Bjoeni	"After arranging images on a GPS trace, I want to write the result coordinates to image headers, but all I get is such error (and a broken jpeg file). 

==== Please provide any additional information below. Attach a screenshot if possible.
Standard error:
{{{
ERROR: Error reading EXIF from file: com.drew.metadata.MetadataException: Tag 'GPS Latitude' has not been set -- check using containsTag() first
java.io.IOException: Write error: org.apache.commons.imaging.formats.jpeg.exif.ExifRewriter$ExifOverflowException: APP1 Segment is too long: 65751
        at org.openstreetmap.josm.plugins.photo_geotagging.ExifGPSTagger.setExifGPSTag(ExifGPSTagger.java:48)
        at org.openstreetmap.josm.plugins.photo_geotagging.GeotaggingAction$GeoTaggingRunnable.realRun(GeotaggingAction.java:231)
        at org.openstreetmap.josm.gui.PleaseWaitRunnable.doRealRun(PleaseWaitRunnable.java:93)
        at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:161)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.commons.imaging.formats.jpeg.exif.ExifRewriter$ExifOverflowException: APP1 Segment is too long: 65751
        at org.apache.commons.imaging.formats.jpeg.exif.ExifRewriter.writeSegmentsReplacingExif(ExifRewriter.java:548)
        at org.apache.commons.imaging.formats.jpeg.exif.ExifRewriter.updateExifMetadataLossless(ExifRewriter.java:394)
        at org.apache.commons.imaging.formats.jpeg.exif.ExifRewriter.updateExifMetadataLossless(ExifRewriter.java:294)
        at org.openstreetmap.josm.plugins.photo_geotagging.ExifGPSTagger.setExifGPSTagWorker(ExifGPSTagger.java:146)
        at org.openstreetmap.josm.plugins.photo_geotagging.ExifGPSTagger.setExifGPSTag(ExifGPSTagger.java:44)
        ... 6 more
}}}

{{{
Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2015-08-06 01:32:57
Last Changed Author: wiktorn
Revision: 8643
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Relative URL: ^/trunk
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2015-08-05 23:51:30 +0200 (Wed, 05 Aug 2015)
Last Changed Rev: 8643

Identification: JOSM/1.5 (8643 en) Windows XP 32-Bit
Memory Usage: 122 MB / 247 MB (12 MB allocated, but free)
Java version: 1.7.0_80, Oracle Corporation, Java HotSpot(TM) Client VM
Program arguments: [--debug]

Plugins:
- InfoMode (31241)
- commons-imaging (31241)
- photo_geotagging (31241)
- reverter (31241)
- undelete (31241)
- utilsplugin2 (31241)

Last errors/warnings:
- E: Error reading EXIF from file: com.drew.metadata.MetadataException: Tag 'GPS Latitude' has not been set -- check using containsTag() first
}}}
"	defect	closed	normal		Plugin photo_geotagging	latest	fixed	template_report, exif	
