ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: blue-j on July 14, 2022, 06:02:17 PM

Title: If a tag does NOT contain...?!
Post by: blue-j on July 14, 2022, 06:02:17 PM
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
Title: Re: If a tag does NOT contain...?!
Post by: Phil Harvey on July 14, 2022, 09:34:40 PM
Aside from the fancy quotes, I don't see why this shouldn't work.  Use plain single quotes.

- Phil
Title: Re: If a tag does NOT contain...?!
Post by: blue-j on July 15, 2022, 02:09:35 AM
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
Title: Re: If a tag does NOT contain...?!
Post by: greybeard on July 15, 2022, 05:16:46 AM
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]
Title: Re: If a tag does NOT contain...?!
Post by: blue-j on July 15, 2022, 01:32:59 PM
And so it does!  Deep bow to the senseis!  - J