ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: fxstein on November 11, 2022, 03:52:29 PM

Title: Potential -if tag issue
Post by: fxstein on November 11, 2022, 03:52:29 PM
Hi,

Edited: As it turns out this is not related to 12.50. My apologies.


12.50 finally made it through my testing pipeline and I am getting a weird warning that did not happen in 12.42.

My process uses '-if "$MIMEType=~/image/" -if "$MIMEType=~/video/"' to filter on image and video files only. Worked in 12.42 (working on verifying).

With 12.50 I am now getting: Warning: Tag 'if' is not defined



Debug details:

[2022-11-11 12:44:13] +_import_media:11> exiftool -r -v2 -progress -o ./test/imported/NODATE/ '-FileCreateDate<FileCreateDate' '-FileCreateDate<CreateDate' '-filename<${FileName}' '-filename<${FileCreateDate;DateFmt("%Y%m%d%H%M%S")}_NODATA_%f.%e' '-filename<${CreateDate;DateFmt("%Y%m%d%H%M%S")}_NODATA_%f.%e' '-filename<${CreateDate;DateFmt("%Y%m%d%H%M%S")}_${Model;s/\s/_/g;}_%f.%e' '-filename<${CreateDate;DateFmt("%Y%m%d%H%M%S")}_${Encoder;s/\s/_/g;}_%f.%e' '-filename<${CreateDate;DateFmt("%Y%m%d%H%M%S")}_${Model;s/\s/_/g;}_${CameraSerialNumber;$_=substr($_,-4);}_%f.%e' '-directory<./test/imported/${FileCreateDate;DateFmt("%Y")}/${FileCreateDate;DateFmt("%Y%m%d")}' '-directory<./test/imported/${CreateDate;DateFmt("%Y")}/${CreateDate;DateFmt("%Y%m%d")}' '-if "$MIMEType=~/image/" -if "$MIMEType=~/video/"' --ext lrv --ext thm --ext xmp --ext . --ext tar --ext gz --ext zip --ext dmg -api 'Filter=s/HERO11 Black/GoPro_Hero11/g; s/HERO10 Black/GoPro_Hero10/g; s/HERO9 Black/GoPro_Hero9/g; s/HERO8 Black/GoPro_Hero8/g; s/GoPro Max/GoPro_Max/g' ./test/originals
[2022-11-11 12:44:14] Warning: Tag 'if' is not defined
Title: Re: Version 12.50 potential -if tag issue
Post by: StarGeek on November 11, 2022, 04:22:31 PM
Quote from: fxstein on November 11, 2022, 03:52:29 PM'-if "$MIMEType=~/image/" -if "$MIMEType=~/video/"'

You have single quotes around this whole thing, creating a tag of that name.  I think what you want would be
-if '$MIMEType=~/image/' -if '$MIMEType=~/video/'
Title: Re: Version 12.50 potential -if tag issue
Post by: fxstein on November 11, 2022, 05:17:03 PM
Yes - indeed. How silly of me. Nothing to do with 12.50
Title: Re: Potential -if tag issue
Post by: fxstein on November 11, 2022, 05:27:25 PM
For completeness here is the correct -if logic:

-if '$MIMEType=~/image/ or $MIMEType=~/video/'

Two separate -if statements are an implicit AND condition. This would have never worked the way I needed it to.

Thank you very much once again!
Title: Re: Potential -if tag issue
Post by: Phil Harvey on November 11, 2022, 09:00:59 PM
Quote from: fxstein on November 11, 2022, 05:27:25 PMTwo separate -if statements are an implicit AND condition.

Correct.