Only Process If Exif exists at all.

Started by captured, October 20, 2014, 10:50:06 AM

Previous topic - Next topic

captured

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.

Phil Harvey

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

captured

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.

Phil Harvey

ExifTool won't ignore a file unless you tell it to.

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