News:

2023-03-15 Major improvements to the new Geolocation feature

Main Menu

Multiple If & No file specified

Started by mulu, March 27, 2020, 12:24:07 PM

Previous topic - Next topic

mulu

I read some threads about multiple if statements but I can't get it to work. Here is what I have:

"exiftool(-k).exe"

-config acdsee-rs.config

-if "defined $RegionInfoACDSeeAppliedToDimensionsw and $orientation=~/Rotate 270 CW|Rotate 90 CW/ and RegionInfoACDSeeAppliedToDimensionsw neq ImageHeight" "-RegionInfoACDSeeAppliedToDimensionsw<ImageHeight" "-RegionInfoACDSeeAppliedToDimensionsh<ImageWidth" -execute

-if "defined $RegionInfoACDSeeAppliedToDimensionsw and not $orientation=~/Rotate 270 CW|Rotate 90 CW/ and RegionInfoACDSeeAppliedToDimensionsw neq ImageWidth" "-RegionInfoACDSeeAppliedToDimensionsw<ImageWidth" "-RegionInfoACDSeeAppliedToDimensionsh<ImageHeight"

-r -P -overwrite_original_in_place "C:\temp\myimage.jpg"

This returns
No file specified
   1 image files updated

It's actually a conflicting message. On hand it says that no file was specified but then it also says 1 image file was updated. Note, the separation on multiple lines is just for this post so it's easier to see what I am doing. In reality this is one single, long line.

StarGeek

Quote from: mulu on March 27, 2020, 12:24:07 PM
It's actually a conflicting message. On hand it says that no file was specified but then it also says 1 image file was updated.

No, it's not conflicting.  See the docs on the -execute option.  Your command breaks down like this.

exiftool(-k).exe -config acdsee-rs.config -if "defined $RegionInfoACDSeeAppliedToDimensionsw and $orientation=~/Rotate 270 CW|Rotate 90 CW/ and RegionInfoACDSeeAppliedToDimensionsw neq ImageHeight" "-RegionInfoACDSeeAppliedToDimensionsw<ImageHeight" "-RegionInfoACDSeeAppliedToDimensionsh<ImageWidth"

Then the -execute starts a new command. Note that there is no filename in that part of the command.

exiftool(-k).exe -config acdsee-rs.config -if "defined $RegionInfoACDSeeAppliedToDimensionsw and not $orientation=~/Rotate 270 CW|Rotate 90 CW/ and RegionInfoACDSeeAppliedToDimensionsw neq ImageWidth" -RegionInfoACDSeeAppliedToDimensionsw<ImageWidth" "-RegionInfoACDSeeAppliedToDimensionsh<ImageHeight" -r -P -overwrite_original_in_place "C:\temp\myimage.jpg"

The -config option carries over (see the docs linked) but nothing else does.  The first command does not have access to the -r -P -overwrite_original_in_place "C:\temp\myimage.jpg"

You need to add the -Common_Args option option at the end
-Common_Args -r -P -overwrite_original_in_place "C:\temp\myimage.jpg"
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

mulu

@StarGeek, ahh I thought -Common_Args is a place holder(!) for the common arguments. Instead, this is a keyword/option after which common arguments follow. I should have realized this since it's written as -Common_Args and not something like [Common_Args]. Thanks a lot!