Trouble with image orientation

Started by rreyer, November 18, 2024, 01:06:58 PM

Previous topic - Next topic

rreyer

I'm having quite some trouble to find out how my images are oriented (landscape vs portrait).

In the past I was using an expression that simply compared the resolution of the image, width vs height to find out if it is landscape or portrait.

Last week I found that the resolution of my NEF files (D800) is now always in LANDSCAPE.
But the flag MD.orientation works fine, so lets use that.

Oh no, my MOV files don't have that flag set correctly and also the resolution expression won't work.
For the MOV files I found the flag MD.Composite\QuickTime-Rotation\Rotation\0 to be working ok.

My Affinity Photo files, however, do not have any correct orientation flags set, so I have to use my expression for the resolution.

And then finally I have a handful JPG files in portrait orientation, that do not have the flags set correctly.
It would be great if I could set their orientation flag manually in the metadata panel, but then they ROTATE, which is wrong again.


So, currently my expression to find out if an image is portrait is this:
isPORTRAIT = {File.Ext|is:afphoto,{File.Width|cast:int;numcomp:gt,{File.Height|cast:int},0,1,0},{File.Ext|is:mov,{File.MD.Composite\QuickTime-Rotation\Rotation\0|is:90,1,{File.MD.Composite\QuickTime-Rotation\Rotation\0|is:270,1,0}},{File.MD.orientation|numcomp:gt,3,1,0},0 },0}


Is there an easier way to do this?
Maybe SET the orientation flag for the various formats, without rotating them?



Mario


QuoteIt would be great if I could set their orientation flag manually in the metadata panel, but then they ROTATE, which is wrong again.
The EXIF orientation tag specifies how to rotate the pixel data in the image for display. If you manipulate it in a way that does not match the physical orientation of the pixels, the output will be wrong.

And yes, the EXIF orientation tag is optional (should not be, but device vendors handle it that way). And video metadata usually does not have EXIF data, except the image was taken with D-SLRs of some vendors.

QuoteLast week I found that the resolution of my NEF files (D800) is now always in LANDSCAPE.
Does IMatch report the wrong width and/or height for these images?
Is the display orientation of the NEF wrong in the Viewer, perhaps?
IMatch stores the width/height of the image in the database when it indexes files, and this is the base for the corresponding variables. Can you send me a sample image to support email address?
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook