Using Filename2Caption ExifTool crashes - photos wont open

Started by Orbitald, May 26, 2014, 12:48:57 PM

Previous topic - Next topic

Orbitald

Hi!

I tried Filename2Caption with a directory of about 100 photos and it worked fine. I then tried it with a folder of 400 photos and it crashed. It seem to have actually screwed up some files, some no longer open and one has a black portions in the photo, and on many files and I found the following files in the directory "filename".JPG_exiftool_tmp.

When I try and open the screwed up files in photoshop it says " jpeg marker segment length is too short. The file may be truncated or incomplete." Is there a good way to fix the corrupt files?

I wrote the writer of the Filename2Caption script and he said "Picasa just starts a script I wrote, and that script starts exiftool."

Thanks a bunch!

David

Phil Harvey

Hi David,

If you send me one of the original files that caused a crash, I will take a look.  My email is philharvey66 at gmail.com

Thanks.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Orbitald


Phil Harvey

Hi David,

The file you sent is not the original.  I was wanting to see if ExifTool had any problems with the original file.

Is it the _exiftool_tmp file that you sent?  It doesn't contain any useful data.

If ExifTool crashed and left a _exiftool_tmp file around, then the original image should be untouched.

At any rate, this should not happen.  The only times I have seen exiftool leave a temporary file is due to a denial-of-service attack by a virus scanner.  So this would be my best guess as to the source of the problem, although I still don't understand the circumstances.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Orbitald

Hi Phil,

The circumstances; I was using Filename2Caption in Picasa to convert the captions of numerous .jpg files (about 400) when my computer froze up with black screen and one small non-blinking cursor near the top. Previously I had converted 100 files and everything went smoothly, the command line script box shows up, does it stuff, and then disappears. This time I had to use a hard restart to get my computer (an HP Pavilion running windows 8) back up and running.

When rebooted I discovered a number of files named .JPG_exiftool_tmp and as well as a number of .jpg files which were not viewable. The names of the .JPG_exiftool_tmp files do not correlate with the .jpg files which are corrupt. In other words, none of the corrupt .jpg files had matching .JPG_exiftool_tmp files.

When I tried to open the corrupt .jpg files in Photoshop it says " jpeg marker segment length is too short. The file may be truncated or incomplete."

I was able to find about a dozen originals of the corrupt files in the picasaoriginals folder but still have 36 corrupt files which I had not previously edited.

The file I sent you was either the original or a file created by exiftool post processing.

I'm happy to provide any information I can toward discovering a solution.

David

Phil Harvey

Hi David,

Thanks for the additional details.

I'm 99.99% sure that the problem is not ExifTool.  It really sounds to me like a bad hard disk.  I recommend running some disk check software on your system.

I asked for an original image just so I could verify that ExifTool wasn't the problem.

Either way, it doesn't appear as if the damaged files can be repaired, sorry.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Orbitald

Hi Phil,

Thanks for looking into this.

What ever the cause the problem happened when I used Filename2Caption / ExifTool to convert a large number of files.

If its OK I'll send you one more file that was corrupted but is partially viewable where the bottom of the photo is now black.

Thanks,

David

Phil Harvey

...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Phil Harvey

I got the other file.  The end of the JPEG image data is all zeros.

I can't see how ExifTool could ever do this, even if it crashes unexpectedly.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Orbitald

Hi Phil,

I believe Filename2Caption opens a new ExifTool for each file. During the process there are many open windows of ExifTool opening and closing simultaneously. I believe I have 12Gig of RAM which seems to be enough to process 100 file but not 400 files.

Thanks,

David

Phil Harvey

Hi David,

I had been thinking about this, and while it may be the source of the problem, I can't see how this could ever cause a file that ends in all zeros.

However, the proper way to do this would be to process all files with a single command.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Orbitald

Thanks for you help Phil!

Working on backing up all my photos before proceeding.

David

Orbitald

Phil,

Why did you take this note out of our conversation thread?

"Edit:  I was thinking about this.  The problem could be something else, but I can't say for sure because I don't know how the Picasa plug-ins work...  If the plug-in launches a separate exiftool process for each source file, and too many files are selected, launching too many exiftool processes simultaneously, then some processes may fail due to lack of memory.  The proper technique would be to launch a single copy of exiftool to process all the input files in one command."

David

Phil Harvey

Hi David,

I was in the middle of editing that post when I received your email with the sample image.  I couldn't reconcile the damage I saw in your image with the lack of memory problem, so I changed my mind.  Even if ExifTool crashes due to lack of memory, it should never corrupt the image (unless the -overwrite_original_in_place option is used, which it wasn't).  Something else must be going on.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Orbitald

OK thanks Phil,

From my point of view this happened as a result of using Filename2Caption with a large number of image files. If it was not Filename2Caption directly then the conversion process brought out a previously unknown, and previously unproblematic, vulnerability in my system. The files were fine when I started the process and corrupt after my computer crashed due to the process.

FYI this is a fairly new computer system and it had never crashed nor have I had to use the hard reset before.

And I understand your wanting to keep the reputation of ExifTool clean especially if you cannot correlate the damage to the files directly with a ExifTool process.

Thanks for your help and wishing you the best.

David