Main Menu

Searching Speifics

Started by edwind, September 22, 2020, 12:17:31 PM

Previous topic - Next topic

edwind

I may be asking in the wrong thing here but does anyone know if it is possible to search a hard drive using exiftool for images of a specific proportion? All my equirectangular images are of the proportion 2:1
Am I asking the impossible?

StarGeek

I did create an Aspect Ratio config file a while back.  Download it and drop it in the same directory as exiftool and you could run
exiftool -config Exiftool_Aspect_Ratio.config -r -if "$AspectRatio eq '2:1' " -filename /path/to/files/

It does need to be an exact ratio, though.  One pixel off and it will return a different ratio.

Swap single/double quotes if you're on Mac/Linux.

"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

Luuk2005

#2
Greetings.  Im soon wish to learn the perl expressions, because so much more can be invented this way!
Im not learned Perl, so post alternate instead, but not understand "equirectangular proportion 2:1" but if "Width==2*Height", this can work.
exiftool -r -if "$ImageSize and ${ImageWidth#} == ${ImageHeight#}*2" -p $filepath .

If translation is "2*Width==Height", relocate "*2" to ImageWidth. Also to remember >= can see the longer ones also, but maybe its better to invent a range?
This invents a range to show files if ImageWidth is  2-3 times ImageHeight, but it conducts all the files because Im not use -ext
exiftool -r -if "$ImageSize and ${ImageWidth#} >= ${ImageHeight#}*2" -if "${ImageWidth#} <= ${ImageHeight#}*3" -p "$ImageWidth  $ImageHeight    $FilePath"  .

**Edit** Im added "$ImageSize and " to block errors for files that are not images, so are without the ImageSize.
Windows8.1-64bit,  exiftool-v12.92(standalone),  sed-v4.0.7

Phil Harvey

This will work for landscape orientation images, but not for portrait orientation.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Luuk2005

Greetings. How can exiftool calculate if picture is landscape or face, and why not also to work for both?
Im editing many portraits and exiftool seems to always conduct the same.
Windows8.1-64bit,  exiftool-v12.92(standalone),  sed-v4.0.7

Alan Clifford

Aren't portrait photos "out of camera" usually actually landscape with the orientation tag set?  So there will only be a problem if the photo has been physically rotated?

Luuk2005

Greetings Alan. Yes, Im not realized there is Exif:Orientation tag! Im usually destroy all my exif, except for study files, so when Mr Harvey says it works for landscapes but not for the portraits, Im think he means it works for images of scenery, but not the faces. It seemed very illogical, so after edited many face pictures, but exiftool always conducted the same, Im getting very confused and must ask the question.

Landscape and portrait is bad words because translation is easy to confuse, so only after research its learned that landscape=wide and portrait=tall. Im always believed that rotating images and saving was really trading the width and height, but not saved in the exif, so now Im learned the Exif:Orientation values for better command.

This to show wide 2X images, includes portrait/tall that is rotated in exifexiftool -if "$Orientation#<5 and ${ImageWidth}==${ImageHeight}*2" -Execute -if "$Orientation#>4 and ${ImageWidth}*2==${ImageHeight}" -Common_args -q -r -if $ImageSize -p $Filepath .
Windows8.1-64bit,  exiftool-v12.92(standalone),  sed-v4.0.7

Phil Harvey

Quote from: Alan Clifford on September 23, 2020, 05:06:47 PM
Aren't portrait photos "out of camera" usually actually landscape with the orientation tag set?  So there will only be a problem if the photo has been physically rotated?

Yes.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).