Unreliable -if

Started by Andi, November 08, 2020, 08:57:28 AM

Previous topic - Next topic

Andi

I use exiftool 11.99

Example:

exiftool -ImageWidth -if '$ImageWidth gt 10000' img.jpg

Wrong result:

Image Width                     : 1200

Then I enter:

exiftool -ImageWidth -if '$ImageWidth gt 1300' img.jpg

Correct result:

    1 files failed condition

greybeard

"gt" is for string comparison - if you want to compare two numeric values use ">"

In your first example it will compare character by character and the second character "2" is greater than "0"