If a tag does NOT contain...?!

Started by blue-j, July 14, 2022, 06:02:17 PM

Previous topic - Next topic

blue-j

I'm trying to make a report of all TIFF files in a directory that do NOT have an alpha channel named "Transparency."

exiftool -fast2 -photoshop:alphachannelsnames -ext tif -if '(not $AlphaChannelsNames =~ /Transparency/)' ~/Desktop/test -csv > ~/Desktop/report.csv

Any help would help me get off the ledge.   : )

- J

Phil Harvey

Aside from the fancy quotes, I don't see why this shouldn't work.  Use plain single quotes.

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

blue-j

Here's the test folder used.  One has an alpha channel called "Transparency" and another does not.  I've attached the report that is issued.  Maybe it's because the one without 'Transparency' actually doesn't have the field at all?

No bueno. 

- J

greybeard

I thing you are correct - the following should work:

exiftool -fast2 -photoshop:alphachannelsnames -ext tif -if '((not defined $AlphaChannelsNames) || (not $AlphaChannelsNames =~ /Transparency/))' ~/Desktop/test -csv > ~/Desktop/report.csv[\code]

blue-j

And so it does!  Deep bow to the senseis!  - J