Author Topic: best way to identify files causing errors (from thousands processed)?  (Read 1948 times)

MikeHardman

  • Newbie
  • *
  • Posts: 5
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

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16724
    • ExifTool Home Page
Re: best way to identify files causing errors (from thousands processed)?
« Reply #1 on: March 22, 2014, 07:02:04 AM »
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, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

MikeHardman

  • Newbie
  • *
  • Posts: 5
Re: best way to identify files causing errors (from thousands processed)?
« Reply #2 on: March 22, 2014, 12:01:53 PM »
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

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 3803
Re: best way to identify files causing errors (from thousands processed)?
« Reply #3 on: March 22, 2014, 03:33:18 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. 
Troubleshooting hints:
* When posting, include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).
* Double all percent signs (%) in a Windows batch file.
* If your GPS coords are negative, make sure and set the GpsLatitudeRef and GpsLongitudeRef tags correctly.

MikeHardman

  • Newbie
  • *
  • Posts: 5
Re: best way to identify files causing errors (from thousands processed)?
« Reply #4 on: March 22, 2014, 06:25:15 PM »
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).
« Last Edit: March 23, 2014, 05:14:24 AM by MikeHardman »