Filtering images for portrait/landscape mode?

Discussion related to "Everything" 1.5.
Post Reply
abr01
Posts: 201
Joined: Tue May 01, 2018 4:57 pm

Filtering images for portrait/landscape mode?

Post by abr01 »

I wonder, if it's possible, since some images also may be sligthly cropped to some non standard values (e.g. being not perfectly 4:3).
And are 'normal' and 'transverse' the equivalent to portrait and landscape? I guess, i would have to re-index the database to in order to filter for aspect ratios.
dedupeit
Posts: 59
Joined: Thu Jul 28, 2022 9:52 pm

Re: Filtering images for portrait/landscape mode?

Post by dedupeit »

I don't know if there's metadata that tells you if an image is in portrait or landscape mode directly but you can get dimensions.
abr01
Posts: 201
Joined: Tue May 01, 2018 4:57 pm

Re: Filtering images for portrait/landscape mode?

Post by abr01 »

dedupeit wrote: Thu Jan 16, 2025 7:12 pm I don't know if there's metadata that tells you if an image is in portrait or landscape mode directly but you can get dimensions.
Like i said, the dimensions may vary. And i have been using around ten different cameras over the years, with all different resolutions.
Thanks for your answer, maybe there is another way.
dedupeit
Posts: 59
Joined: Thu Jul 28, 2022 9:52 pm

Re: Filtering images for portrait/landscape mode?

Post by dedupeit »

With dimensions, I can use this to find landscape

Code: Select all

dimensions: add-column:a a:=regexextract(dimensions:,"(.*)x") add-column:b b:=regexextract(dimensions:,"x(.*)") columna:>columnb:
And switch the comparison to find portrait

Code: Select all

dimensions: add-column:a a:=regexextract(dimensions:,"(.*)x") add-column:b b:=regexextract(dimensions:,"x(.*)") columnb:>columna:
This takes the dimension, which is in the format of <width>x<height> and puts width in column A and height in column B.
abr01
Posts: 201
Joined: Tue May 01, 2018 4:57 pm

Re: Filtering images for portrait/landscape mode?

Post by abr01 »

That looks interesting indeed. I'm not sure, if i can put it into a custom Directory Opus mode, though.
i will check that. Do i need to make a new index for that? I guess i will, because i don't have the dimensions included yet. Thanks!
therube
Posts: 5723
Joined: Thu Sep 03, 2009 6:48 pm

Re: Filtering images for portrait/landscape mode?

Post by therube »

Can Everything read EXIF (tag), Orientation (value)?
(I suppose it can, if Windows does see it?)
abr01
Posts: 201
Joined: Tue May 01, 2018 4:57 pm

Re: Filtering images for portrait/landscape mode?

Post by abr01 »

therube wrote: Thu Jan 16, 2025 8:46 pm Can Everything read EXIF (tag), Orientation (value)?
(I suppose it can, if Windows does see it?)
Thanks for the additional hint, i re-started the indexer, including 'orientation' now.
dedupeit
Posts: 59
Joined: Thu Jul 28, 2022 9:52 pm

Re: Filtering images for portrait/landscape mode?

Post by dedupeit »

therube wrote: Thu Jan 16, 2025 8:46 pm Can Everything read EXIF (tag), Orientation (value)?
(I suppose it can, if Windows does see it?)
Oh nice, I thought I looked and didn't see Orientation as an option but I see it now.
abr01
Posts: 201
Joined: Tue May 01, 2018 4:57 pm

Re: Filtering images for portrait/landscape mode?

Post by abr01 »

dedupeit wrote: Thu Jan 16, 2025 9:08 pm
therube wrote: Thu Jan 16, 2025 8:46 pm Can Everything read EXIF (tag), Orientation (value)?
(I suppose it can, if Windows does see it?)
Oh nice, I thought I looked and didn't see Orientation as an option but I see it now.
Same here. :)
NotNull
Posts: 5961
Joined: Wed May 24, 2017 9:22 pm

Re: Filtering images for portrait/landscape mode?

Post by NotNull »

Properties don't need to be indexed to be used. It is just slower as the information has to be extracted from each individual image.
Indexing this information makes these searches instant (in case you need it more often).

Everything is also aware of the height, width and aspect ratio of images. As a demo, try the following search:
pic: add-column:width,height,aspect-ratio



To get a landscape/portrait column (ignoring the square images):

Code: Select all

pic:  add-column:A  A:=sign(int($aspect-ratio:))?"Landscape":"Portrait"
To find the Portrait pictures:

Code: Select all

pic:  addcol:A   A:=sign(int($aspect-ratio:))?"Landscape":"Portrait"  $A:="Portrait"


EDIT: All below is untested and turned out to be incorrect

I read about orientation a bit (here) and as far as I understand, it can transform the way the picture will be shown: a picture that was taken in "landscape", but should be shown in "portrait"? Change the orientation.

Assuming Everything uses numbers 1-8 to indicate different orientations (see link), the following should show the "endresult":

Code: Select all

pic:  add-columns:width,height,orientation,A  A:=XOR(sign(int($aspect-ratio:)),int(($orientation:-1)/4)?"Landscape":"Portrait"
abr01
Posts: 201
Joined: Tue May 01, 2018 4:57 pm

Re: Filtering images for portrait/landscape mode?

Post by abr01 »

NotNull wrote: Fri Jan 17, 2025 12:32 am Properties don't need to be indexed to be used. It is just slower as the information has to be extracted from each individual image.
Indexing this information makes these searches instant (in case you need it more often).

Everything is also aware of the height, width and aspect ratio of images. As a demo, try the following search:
pic: add-column:width,height,aspect-ratio



To get a landscape/portrait column (ignoring the square images):

Code: Select all

pic:  add-column:A  A:=sign(int($aspect-ratio:))?"Landscape":"Portrait"
To find the Portrait pictures:

Code: Select all




All below is untested:
I read about orientation a bit (here) and as far as I understand, it can transform the way the picture will be shown: a picture that was taken in "landscape", but should be shown in "portrait"? Change the orientation.

Assuming Everything uses numbers 1-8 to indicate different orientations (see link), the following should show the "endresult":

Code: Select all

pic:  add-columns:width,height,orientation,A  A:=XOR(sign(int($aspect-ratio:)),int(($orientation:-1)/4)?"Landscape":"Portrait"
Regarding the indexing, too late, i'm at 97% already. :)

And, even the other stuff is very interesting too, the two codes to show landscape or portrait, that exactly what i was looking for. But the next obstacle is, how to get this into the right form to be used inside Directory Opus. But i have managed to get a few other searches to work (with help from the guys), so it would be managable somehow. Or is there any known way already, how to hand over the results from Everything's list top Opus?

...

still testing, now i use

"K:\Bilder\Fotografie\*\*" pic: addcol:A A:=sign(int($aspect-ratio:))?"Landscape":"Portrait" $A:="Portrait"

which is very promising, but surprisingly slow (even though it has found almost 77,000 images), given that i just had a full indexing including 'orientation'.

Another thing, that i just found out, i can select images directly in ET, and use 'send to' into an Opus collection, which is very cool. But is there a way to hard code that 'send to' into some command (using the same collection all the time), instead of going through the context menue? Maybe not, because i guess that's Windows' functionality there. And, sorry for having so many sub topics, while the search is still running, i see the images jumping around in ETs list, so i 'freezed' the list now by having the search stopped. I also see landscape mode imeges inbetween, but they seem to be wedged out in real time.

Update: problem solved so far, i can drag & drop from ET right into the collection, which is much easier.


Anyway, that's already all very helpful, thanks! :idea:
abr01
Posts: 201
Joined: Tue May 01, 2018 4:57 pm

Re: Filtering images for portrait/landscape mode?

Post by abr01 »

By the way, this shorter version also works:

"K:\Bilder\Fotografie\*\*" orientation:landscape

But i wonder, why it takes so very long, even though 'orientation' is indexed now. After around 5 minutes the search is still at 6%.
Is there another property, which is required to make the search almost instantaneously?
NotNull
Posts: 5961
Joined: Wed May 24, 2017 9:22 pm

Re: Filtering images for portrait/landscape mode?

Post by NotNull »

abr01 wrote: Fri Jan 17, 2025 3:32 am orientation:landscape
When that does work, my interpretation of the orientation property is clearly wrong. Please ignore the related column definition (the last search query)
abr01
Posts: 201
Joined: Tue May 01, 2018 4:57 pm

Re: Filtering images for portrait/landscape mode?

Post by abr01 »

While the code works fine, i found, that adding a rating clause to it, like in the example, mixes portrait mode and 5 stars rating in an OR mode, so that i also get landscape mode mixed into my list.

Is there a way to get AND mode working, so that i would only get portrait mode and 5 stars rating in my find list?


"D:\Fotografie\*\*" pic: addcol:A A:=sign(int($aspect-ratio:))?"Landscape":"Portrait" $A:="Portrait" rating:5stars

EDIT:

Hmm, i had another run, but this time it worked as intended.
Post Reply