Index: applications/editors/josm/plugins/photo_geotagging/build.xml
===================================================================
--- applications/editors/josm/plugins/photo_geotagging/build.xml	(revision 24096)
+++ applications/editors/josm/plugins/photo_geotagging/build.xml	(revision 24097)
@@ -25,5 +25,5 @@
 
 	<!-- enter the SVN commit message -->
-	<property name="commit.message" value="remember selection of mtime (save to preference file)" />
+	<property name="commit.message" value="applied patch by ax (JOSM ticket 5602) - photo_geotagging fails to write coordinates into image header on win32" />
 	<!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
 	<property name="plugin.main.version" value="3408" />
Index: applications/editors/josm/plugins/photo_geotagging/src/org/openstreetmap/josm/plugins/photo_geotagging/GeotaggingAction.java
===================================================================
--- applications/editors/josm/plugins/photo_geotagging/src/org/openstreetmap/josm/plugins/photo_geotagging/GeotaggingAction.java	(revision 24096)
+++ applications/editors/josm/plugins/photo_geotagging/src/org/openstreetmap/josm/plugins/photo_geotagging/GeotaggingAction.java	(revision 24097)
@@ -14,4 +14,5 @@
 import java.util.ArrayList;
 import java.util.List;
+import java.util.UUID;
 
 import javax.swing.AbstractAction;
@@ -44,4 +45,5 @@
  */
 class GeotaggingAction extends AbstractAction implements LayerAction {
+    
     final static boolean debug = false;
     final static String KEEP_BACKUP = "plugins.photo_geotagging.keep_backup";
@@ -272,5 +274,11 @@
         private void chooseFilesNoBackup(File file) throws IOException {
             File fileTmp;
-            fileTmp = File.createTempFile("img", ".jpg", file.getParentFile());
+            //fileTmp = File.createTempFile("img", ".jpg", file.getParentFile());
+            // on win32, file.renameTo(fileTmp) does not work when the destination file exists 
+            // see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4017593
+            // so we cannot use createTempFile(), which would create that "existing destination file" 
+            // instead, let's use new File(), which doesn't actually create a file
+            // for getting a unique file name, we use UUID.randomUUID()
+            fileTmp = new File(file.getParentFile(), "img" + UUID.randomUUID() + ".jpg");
             if (debug) {
                 System.err.println("TMP: "+fileTmp.getAbsolutePath());
