Custom column for display only

Started by theprof, November 04, 2024, 07:13:35 AM

Previous topic - Next topic

theprof

I have the following EXIF command in my BASH script:
exiftool -m -e -n -F -q -q -f -r -json -api QuickTimeUTC -api ignoretags=all -FileType -CoverArt -CompressorName -CompressorID
I just want to know whether the video has CoverArt or not instead of the "use -b option to extract" text (the text is interfering the way the data is parsed in the script). I also don't want to use a config file.

Is it possible to have some kind of true/false value for cover art (or a custom column without using config file)?


Phil Harvey

A user-defined tag in a config file would be the best way, however the API Filter option could be used as a work-around:

exiftool -b -m -e -F -q -q -f -r -json -api QuickTimeUTC -api ignoretags=all -FileType# -CoverArt -CompressorName# -CompressorID# -api filter='$_="Yes" if /^\xff/'
To get this to work I've had to remove -n so I've added "#" to the end of the other tag names.  Also, I needed to add -b.  This will work only if the CoverArt is JPEG format.  To work for other image formats you would have to expand the regex to match these files. 

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