ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: captured on October 20, 2014, 10:50:06 AM

Title: Only Process If Exif exists at all.
Post by: captured on October 20, 2014, 10:50:06 AM
Hello.

I wish to know if an image has or has not Exif.
I have to do this in (2) passes now and it's taking too long.

Debian testing Linux;

$ if [ "$(exiftool -f -T -q -DateTimeOriginal "$z")" = "-" ]; then
ExifListAll="$(find "$ImageDir" -maxdepth 1 -type f ! -type l | grep -E "JPG|RAF|CR2" \
| xargs -P2 exiftool -T -FileName -d '%F %T' -DateTimeOriginal -AutoBracketing \
-SequenceNumber | sort -k2,2 -k3,3 -k5,5n)"

Is there a better way to determine if an image has any exif or not ?

Thank you.
Title: Re: Only Process If Exif exists at all.
Post by: Phil Harvey on October 20, 2014, 12:24:12 PM
I don't know what you want to do, but this will conditionally process a file based on the existence of EXIF:

exiftool -if '$exif:all' ...

- Phil
Title: Re: Only Process If Exif exists at all.
Post by: captured on October 20, 2014, 05:46:38 PM
Thank you Phil.

If I try to use exiftool on a file that does not have exif, or corresponding exif field...
does exiftool ignore the file ?

e.g.
exiftool -T -FileName -d '%F %T' -DateTimeOriginal -AutoBracketing -SequenceNumber <filename>

For example...
If the above tries to extract exif on a file that has no exif, or no "-AutoBracketing" Maker Note... will exiftool skip output of it ?

Thank you for your response.
Title: Re: Only Process If Exif exists at all.
Post by: Phil Harvey on October 20, 2014, 07:09:21 PM
ExifTool won't ignore a file unless you tell it to.

- Phil