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.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

felciano

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

Ramon