Ticket #5602: photo_geotagging.patch
| File photo_geotagging.patch, 1.7 KB (added by , 15 years ago) |
|---|
-
GeotaggingAction.java
13 13 import java.text.DecimalFormat; 14 14 import java.util.ArrayList; 15 15 import java.util.List; 16 import java.util.UUID; 16 17 17 18 import javax.swing.AbstractAction; 18 19 import javax.swing.BorderFactory; … … 43 44 * The action to ask the user for confirmation and then do the tagging. 44 45 */ 45 46 class GeotaggingAction extends AbstractAction implements LayerAction { 47 46 48 final static boolean debug = false; 47 49 final static String KEEP_BACKUP = "plugins.photo_geotagging.keep_backup"; 48 50 final static String CHANGE_MTIME = "plugins.photo_geotagging.change-mtime"; … … 271 273 272 274 private void chooseFilesNoBackup(File file) throws IOException { 273 275 File fileTmp; 274 fileTmp = File.createTempFile("img", ".jpg", file.getParentFile()); 276 //fileTmp = File.createTempFile("img", ".jpg", file.getParentFile()); 277 // on win32, file.renameTo(fileTmp) does not work when the destination file exists 278 // see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4017593 279 // so we cannot use createTempFile(), which would create that "existing destination file" 280 // instead, let's use new File(), which doesn't actually create a file 281 // for getting a unique file name, we use UUID.randomUUID() 282 fileTmp = new File(file.getParentFile(), "img" + UUID.randomUUID() + ".jpg"); 275 283 if (debug) { 276 284 System.err.println("TMP: "+fileTmp.getAbsolutePath()); 277 285 }
