Correct use of conditional -if to check for image orientation (rotation)?

Started by felciano, November 16, 2018, 10:40:11 PM

Previous topic - Next topic

felciano

Hi --

I'm trying to learn how to use EXIFTool to process images that have been rotated. I've browsing the forums to try to address this and have been trying to implement the syntax illustrated in https://exiftool.org/forum/index.php/topic,6466.msg32225.html#msg32225. However I seem to not quite have the conditional syntax down correctly:

MiMac:dircheck$ exiftool -Orientation "rotatetest/rotated 2016-01-22 12.50.55 (iPhone 6).jpg_original"
Orientation                     : Rotate 90 CW
MiMac:dircheck$ exiftool -if "$orientation and $orientation =~ /(90|270)/" "rotatetest/rotated 2016-01-22 12.50.55 (iPhone 6).jpg_original"
    1 files failed condition
MiMac:dircheck$

I've tried various configurations but it always ends up with a "failed condition" message. What am I missing?

Thanks, in advance,

Ramon

StarGeek

On a Mac?  Swap single/double quotes.

Double quotes cause $orientation to be treated as a shell variable.
* 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).

felciano

Wow -- I never would have caught that! Thank you -- works perfectly now.

Ramon