Modify

Opened 5 years ago

Closed 5 years ago

#10045 closed defect (fixed)

Could not rename file! when writing geolocation data

Reported by: pnorman Owned by: bastiK
Priority: normal Milestone:
Component: Plugin photo_geotagging Version: tested
Keywords: Cc:

Description (last modified by Don-vip)

This is probably something specific to one of my files, but when you've got 2k images in a directory it's a bit hard to be specific.

Steps to produce:

Load GPX files
Load and correlate images to the 3-4 files

Write to header, altering timestamps, no backup

The error "Could not rename file!" appears

This is the console output

INFO: Open 1951 files
INFO: GET https://api.openstreetmap.org/api/0.6/user/details (get number of unread messages)
INFO: GET https://api.openstreetmap.org/api/0.6/user/details (get number of unread messages)
ERROR:  Invalid image
java.io.IOException: Could not rename file!
        at org.openstreetmap.josm.plugins.photo_geotagging.GeotaggingAction$GeoTaggingRunnable.chooseFilesNoBackup(GeotaggingAction.java:290)
        at org.openstreetmap.josm.plugins.photo_geotagging.GeotaggingAction$GeoTaggingRunnable.chooseFiles(GeotaggingAction.java:251)
        at org.openstreetmap.josm.plugins.photo_geotagging.GeotaggingAction$GeoTaggingRunnable.realRun(GeotaggingAction.java:212)
        at org.openstreetmap.josm.gui.PleaseWaitRunnable.doRealRun(PleaseWaitRunnable.java:82)
        at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:150)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:724)

Version 7000

Attachments (0)

Change History (14)

comment:1 Changed 5 years ago by Don-vip

Component: Core image mappingPlugin photo_geotagging
Owner: changed from team to bastiK

comment:2 Changed 5 years ago by Don-vip

Description: modified (diff)

comment:3 Changed 5 years ago by Don-vip

Description: modified (diff)

comment:4 Changed 5 years ago by Don-vip

As file renaming is OS-dependent, could you please attach your status report? (first three blocks of Help->Show Status report). Thanks.

comment:5 in reply to:  4 Changed 5 years ago by bastiK

In [o30457].

Please try again.

Also this:

Replying to Don-vip:

As file renaming is OS-dependent, could you please attach your status report? (first three blocks of Help->Show Status report). Thanks.

comment:6 Changed 5 years ago by Don-vip

@bastiK: If needed, Java 7 has introduced a new method to rename files, with proper exceptions when something goes wrong.

comment:7 Changed 5 years ago by pnorman

Updated to 7146, error still occurs, but it now gives more information

Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2014-05-20 01:35:44
Last Changed Author: simon04
Revision: 7146
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2014-05-19 18:17:18 +0200 (Mon, 19 May 2014)
Last Changed Rev: 7146

Identification: JOSM/1.5 (7146 en) Windows 7 64-Bit
Memory Usage: 1963 MB / 1963 MB (1060 MB allocated, but free)
Java version: 1.7.0_25, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
VM arguments: [-Xmx2G]
ERROR:  Invalid image
java.io.IOException: Could not rename file H:\osm\photos\245_0518\IMG_0258.JPG to H:\osm\photos\245_0518\imga7b0f250-b12
9-463c-affb-8529c0966584.jpg!
        at org.openstreetmap.josm.plugins.photo_geotagging.GeotaggingAction$GeoTaggingRunnable.chooseFilesNoBackup(Geota
ggingAction.java:292)
        at org.openstreetmap.josm.plugins.photo_geotagging.GeotaggingAction$GeoTaggingRunnable.chooseFiles(GeotaggingAct
ion.java:251)
        at org.openstreetmap.josm.plugins.photo_geotagging.GeotaggingAction$GeoTaggingRunnable.realRun(GeotaggingAction.
java:212)
        at org.openstreetmap.josm.gui.PleaseWaitRunnable.doRealRun(PleaseWaitRunnable.java:82)
        at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:150)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:724)
INFO: GET https://api.openstreetmap.org/api/0.6/user/details (get number of unread messages)

Potentially related: I have thumbnails on, but one image doesn't show the thumbnail, it shows the small camera icon. That image is IMG_0257.JPG, the one before the one the error reports.

comment:8 Changed 5 years ago by pnorman

Note: When rerunning it, I now get it erroring on

java.io.IOException: Could not rename file H:\osm\photos\245_0518\IMG_1297.JPG to H:\osm\photos\245_0518\imgcab15738-107
d-442d-80c0-c843e9602a20.jpg!}}}

comment:9 in reply to:  7 Changed 5 years ago by bastiK

Replying to pnorman:

Potentially related: I have thumbnails on, but one image doesn't show the thumbnail, it shows the small camera icon. That image is IMG_0257.JPG, the one before the one the error reports.

This sounds indeed suspicious.

Please make a copy of your folder before running it again. With the new information on the console, try to reproduce the error when geotagging only 1-3 photos and attach those photos (or send to phaaurlt@…).

comment:10 Changed 5 years ago by pnorman

Please make a copy of your folder before running it again. With the new information on the console, try to reproduce the error when geotagging only 1-3 photos and attach those photos (or send to phaaurlt@…)

I did some tests, and it doesn't always error on the same photos. The complete directories of 2k images are ~4GB

I've been unable to produce the error on a directory with just a few photos, but this could just be statistics.

comment:11 Changed 5 years ago by bastiK

In [o30462].

Ok, let's try the new Java 8 IO. Otherwise I have no idea what could be the problem, sorry.

comment:12 Changed 5 years ago by Don-vip

@pnorman: is the problem fixed?

comment:13 Changed 5 years ago by anonymous

Looks like it's working now - I tried a folder of 1500 twice without errors.

comment:14 Changed 5 years ago by pnorman

Resolution: fixed
Status: newclosed

Above was me.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain bastiK.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.