Thread

Posted on Mon Jun 11 12:48:17 2007 by hharink
exiftool.exe error renaming
Not completely sure if im on the right spot to ask this question but anyway I have an windows XP SP2 laptop with exiftool.exe (6.90) a jpg file called test.jpg in the directory c:\test and exiftool.exe in the same directory i open a commandbox run cmd and issue the following statement Exiftool "-DateTimeOriginal+=5:10:2 10:48:0" test.jpg i get the errormessage error renaming test.jpg and if i do a DIR of the test directory is see test.jpg AND a file called test.jpg_exiftool_tmp the tmp file has the requested exif data changed, the file test.jpg is still in its original state.
Direct Responses: 5390 | Write a response
Posted on Mon Jun 11 15:39:37 2007 by exiftool in response to 5389
Re: exiftool.exe error renaming
This is the right spot to ask that question.

It sounds like somehow you don't have permission to rename the original file. These are the steps that exiftool takes when writing an image:

1) Write modified image to "FILE_exiftool_tmp".
2) Rename original image to "FILE_original".
3) Rename temporary file to "FILE".

This is failing at step number 2. Check the permissions on the image. I'm not familiar with the how to do this in Windows, but hopefully you know how or maybe someone else can help here.

- Phil
Direct Responses: 5392 | 5394 | Write a response
Posted on Mon Jun 11 22:21:07 2007 by hharink in response to 5390
Re: exiftool.exe error renaming
Ah well if i do it myself on the commandline it works rename test.jpg test.jpg_original so the permissions should be oke unless the program is run as a different user.. but then cacls says BUILTIN\Administrators:F NT AUTHORITY\SYSTEM:F WULFTOP\hennie:F BUILTIN\Users:R i myself am logged in as hennie. i tried it with changing BUILTIN\Users:F but it did not help.
Write a response
Posted on Mon Jun 11 22:39:23 2007 by hharink in response to 5390
Re: exiftool.exe error renaming
Ah well if i do it myself on the commandline it works rename test.jpg test.jpg_original so the permissions should be oke unless the program is run as a different user.. but then cacls says BUILTIN\Administrators:F NT AUTHORITY\SYSTEM:F WULFTOP\hennie:F BUILTIN\Users:R i myself am logged in as hennie. i tried it with changing BUILTIN\Users:F but it did not help.
Direct Responses: 5395 | Write a response
Posted on Mon Jun 11 22:47:44 2007 by hharink in response to 5394
Re: exiftool.exe error renaming
And it IS something like you say because if i use......Exiftool -o testout.jpg "-DateTimeOriginal+=5:10:2 10:48:0" test.jpg.................Then everything goes fine. But nevertheles i would like to change the original and have no idea what causes this behaviour.
Direct Responses: 5396 | Write a response
Posted on Mon Jun 11 22:59:11 2007 by hharink in response to 5395
Re: exiftool.exe error renaming
Oke little bit more info out of testing.... use option -overwrite_original gives errors........ errors are 0 image files update 1 files werent updated due to errors and the exif_tool_tmp file exists..... user option -overwrite_origina_in_place WORKS.... but allso here the exif_tool_tmp file exists still and is not gone BUT the original is now written.
Direct Responses: 5406 | Write a response
Posted on Tue Jun 12 15:39:06 2007 by exiftool in response to 5396
Re: exiftool.exe error renaming
It seems like a problem specifically with the rename function (and maybe the delete function), because -overwrite_original_in_place is able to open the original file for writing.

So I think it comes down to something different about your operating system. What OS are you running? Also, what version of ExifTool (the stand-alone Windows version 6.90?).

It must be something very specific to your system because I haven't seen this problem before.

Also, do you have Perl installed, and did you ever install any other versions of ExifTool using a different installation technique? (I'm wondering about possible library conflicts between versions.)

- Phil
Direct Responses: 5408 | 5415 | Write a response
Posted on Tue Jun 12 16:13:38 2007 by hharink in response to 5406
Re: exiftool.exe error renaming
I just tried exiftool now so have the current version, never tried it before.\n I am using windows XP Home edition.\n It works in windows safe mode.\n I have trie first the windows executable. \n today i have install active perl and got the perl distribution. \n This gives the same result. \n a standard simple perl rename script wich i wrote and tested on the same jpg file gives no problems. \n Hmm how do i get a linefeed in this forum working?\n
Direct Responses: 5410 | Write a response
Posted on Tue Jun 12 16:25:01 2007 by exiftool in response to 5408
Re: exiftool.exe error renaming
(you have to type <br> to get a line feed in this forum, or two for a blank line)

There is nothing weird about your OS version. I forgot to ask, but you're using the cmd.exe shell?

That was smart to try the rename command separately, but now it is even more of a puzzle as to why it doesn't work. Could you try these two commands?:

> exiftool -author=me test.mie 1 image files created > exiftool -author=you test.mie 1 image files updated

I just want to see what happens when you try to edit a file that is created initially by exiftool.

- Phil
Direct Responses: 5411 | Write a response
Posted on Tue Jun 12 17:03:42 2007 by hharink in response to 5410
Re: exiftool.exe error renaming
Oke first your test
C:\test exiftool -author=me test.mie
1 image files created

C:\test exiftool -author=you test.mie
Error renaming test.mie

Then i found your the piece in the exiftool code that does the renaming and copied it into a simple test
This WORKS....... its is indeed very strange...
I tried to copy it into this forum but it doesnt want to except it
Direct Responses: 5412 | Write a response
Posted on Tue Jun 12 17:13:53 2007 by hharink in response to 5411
Re: exiftool.exe error renaming
yes i use the cmd exe shell (forgot to anwer that one)
Direct Responses: 5414 | Write a response
Posted on Tue Jun 12 17:29:38 2007 by exiftool in response to 5412
Re: exiftool.exe error renaming
(to post a block of code to the forum, enclose it in <code> ... </code> )

If I could duplicate this problem I could iterate between the script that works and the full exiftool script that doesn't. At some point there must be a single reason that one works. Do you think there could be a problem with the long extensionn (ie. "image.jpg_original"), or can your rename a file to a name like this?

- Phil
Direct Responses: 5416 | 5417 | Write a response
Posted on Tue Jun 12 17:33:32 2007 by hharink in response to 5406
Re: exiftool.exe error renaming
I just tried exiftool now so have the current version, never tried it before.\n I am using windows XP Home edition.\n It works in windows safe mode.\n I have trie first the windows executable. \n today i have install active perl and got the perl distribution. \n This gives the same result. \n a standard simple perl rename script wich i wrote and tested on the same jpg file gives no problems. \n Hmm how do i get a linefeed in this forum working?\n
Write a response
Posted on Tue Jun 12 17:41:03 2007 by hharink in response to 5414
Re: exiftool.exe error renaming
Ah well like i said i copied your rename code from the exiftool.pl
and put it in a simple script.
keeping the names like they are
and that works oke. so it mut be something that happens before that makes the file cannot be renamed.
i would think.....
I never used perl so have difficultys reading all, otherwise i could try to debug myself, wich i am trying anyway ....
my guesses . some program in my latop like a firewall virusscan windows defender is still holding the file
i tried to put a delay 10 before the rename i did not help
other idea the file is opened and locked by the prog itself
i tried to make a file handle did open fhandel filename
and then close fhandel filename
did allso did not give a soluytion
i allso tried to lock and unlock it before did not help eather
but as said this is the first time i look into perl so....
Write a response
Posted on Tue Jun 12 17:41:34 2007 by hharink in response to 5414
Re: exiftool.exe error renaming
Ah well like i said i copied your rename code from the exiftool.pl
and put it in a simple script.
keeping the names like they are
and that works oke. so it mut be something that happens before that makes the file cannot be renamed.
i would think.....
I never used perl so have difficultys reading all, otherwise i could try to debug myself, wich i am trying anyway ....
my guesses . some program in my latop like a firewall virusscan windows defender is still holding the file
i tried to put a delay 10 before the rename i did not help
other idea the file is opened and locked by the prog itself
i tried to make a file handle did open fhandel filename
and then close fhandel filename
did allso did not give a soluytion
i allso tried to lock and unlock it before did not help eather
but as said this is the first time i look into perl so....
Direct Responses: 5418 | Write a response
Posted on Tue Jun 12 17:46:56 2007 by exiftool in response to 5417
Re: exiftool.exe error renaming
I appreciate the work you are doing to track this down, because all I can do from my end is come up with ideas.

Here's one: Put the following line in exiftool just before it dies on the rename error (this will print the actual error message):

print "The error is: $!\n";

- Phil
Direct Responses: 5419 | Write a response
Posted on Tue Jun 12 18:00:17 2007 by hharink in response to 5418
Re: exiftool.exe error renaming
The error is: permissiom denied
Direct Responses: 5421 | Write a response
Posted on Tue Jun 12 18:44:07 2007 by exiftool in response to 5419
Re: exiftool.exe error renaming
OK, thanks. This confirms my initial suspicions. I think maybe the thing to try now is to disable all of your virus protection to see if it is causing the problem. Unfortunately I'm not an expert in Windows permissions, so hopefully you or someone else reading this forum will have some more ideas here.

- Phil
Direct Responses: 5423 | Write a response
Posted on Tue Jun 12 20:07:39 2007 by hharink in response to 5421
Re: exiftool.exe error renaming
Ah thanx for all your help thats first!
as i mentioned before i allready tought i tried to shut down all my firewals and scanners though...
The Norman Antivirus i thought to have stopped by selecting , stop on access scanning, as that is the only option available.
But i thought ill go a little bit further now and stopped all the norman av services in windows and restarted.
and guess what the problem does not exist anmore
Now ill be busy to solve the norman problem as i do like it and all virusprograms have some kine of problems.....
Thanx again for thinking with me and i know now a lot more about perl then i did before!
Hennie
Direct Responses: 5425 | Write a response
Posted on Tue Jun 12 21:26:04 2007 by exiftool in response to 5423
Re: exiftool.exe error renaming
Excellent.

Please post your solution here if you figure out how to configure Norton (Norman?) Antivirus to solve this conflict.

- Phil
Direct Responses: 5460 | Write a response
Posted on Mon Jun 18 17:36:25 2007 by hharink in response to 5425
Re: exiftool.exe error renaming
I have tried to take active scan away from the directory the files are in with no solution. even stopping activescan completely did not help. I sent an email to Norman (not norton) with the problem explained so waiting for an answer from that. In the meantime im running AVG antivirus and everything works fine. If anything comes from norman ill post it here. Hennie
Write a response