best way to identify files causing errors (from thousands processed)?

Started by MikeHardman, March 22, 2014, 04:52:22 AM

Previous topic - Next topic

MikeHardman

Situation:
Summary the end of an ExifTool run:

406 directories scanned
2530 image files updated
    2 files weren't updated due to errors

What is the best way to identify which files gave the errors, and what those errors were?
...Preferably without generating a -w file for each image file.

Phil Harvey

The stderr output should contain an "Error:" line for each file that gave errors.

- 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 ($).

MikeHardman

Thanks Phil,
I should have said: I'm running ExifTool through ExifMixer - so I don't think I get an option to trap stderr  :(

Maybe I can run another pass through the same directory tree, checking for a value I was trying to insert (which would have failed and hence be null) - and deduce the affected files that way.
How do I check if a tag exists (or is null)?

//Mike

StarGeek

Quote from: MikeHardman on March 22, 2014, 12:01:53 PM
Maybe I can run another pass through the same directory tree, checking for a value I was trying to insert (which would have failed and hence be null) - and deduce the affected files that way.
How do I check if a tag exists (or is null)?

To check if a tag exists, you can use this command:
ExifTool -r -if "not defined $TAG" -filename <FILE/DIR>
So if your tag is Caption-Abstract for example, replace "TAG" with Caption-Abstract.  Since you mentioned a directory tree, I added -r so it would recurse through the entire tree.

To check for your exact tag, you could use this command:
ExifTool -r -if "$TAG eq 'VALUE' " -filename <FILE/DIR>
where you would replace "VALUE" with the data you were inserting.  Though this won't work if you were adding a list type tag such as Keywords or Subject, unless it was the only item there.  In that case you could use this command:
ExifTool -r -if "$TAG=~/VALUE/" -filename <FILE/DIR>

But you first might want to try this command:
ExifTool -r -if "$warning" -warning <FILE/DIR>
This can pick up on a few errors your files. 
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

MikeHardman

Star Geek,
Thanks v. much.
I shall have a play with those, and have noted the logic syntax for future ref.

Update: the problems were due to the two files being readonly (gawd knows why).