RAW photos are not rotated automatically

Started by ChicagoGhost, November 01, 2024, 02:50:41 AM

Previous topic - Next topic

ChicagoGhost

IMatch displays my RAW photos (CR2 files, which were shot in portrait mode) in the wrong orientation. They are displayed in landscape mode. JPG files are fine.
There are no sidecar files to these photos.
They are displayed in the correct orientation in Lightroom or Windows File Explorer.
It needs a lot of work to manually rotate them one by one.
Is there a setting to display them correctly, or a command to find all these photos, group them together, and apply the rotation to them all?

Mario

CR2 is a proprietary and undocumented file format.
Which camera and firmware version do you use?
Do you use WIC or LibRaw?

If you use WIC, try LibRaw ("Prefer photools.com RAW Processing" in Edit > Preferences > Application) and then force an update of affected files by selecting them in a File Window and pressing Shift+Ctrl+F5 > Force Update).

-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

ChicagoGhost

Quote from: Mario on November 01, 2024, 08:26:23 AMWhich camera and firmware version do you use?

The camera I used is a Canon 1DX Mark II.

Quote from: Mario on November 01, 2024, 08:26:23 AMDo you use WIC or LibRaw?
I tested using the "WIC Diagnostics" tool.
It says: WIC Result: A codec for this file format is installed and it looks like it fully supports the format.
The image is displayed in the correct orientation in Windows File Explorer but in the wrong orientation in IMatch.

Quote from: Mario on November 01, 2024, 08:26:23 AMIf you use WIC, try LibRaw ("Prefer photools.com RAW Processing" in Edit > Preferences > Application) and then force an update of affected files by selecting them in a File Window and pressing Shift+Ctrl+F5 > Force Update).

After this step, the image is shown in the correct orientation in IMatch.
Compared with the WIC, how is the performance using LibRaw?
Because I have a lot of files to update, the easiest way is to select all RAW files or even all image files and update them all. Another way is to select portrait images only.

Mario

Since Microsoft apparently is using LibRaw in at least some of their WIC codecs (to save money, I suppose), I guess the performance is good. Affinity uses LibRaw in their products to load RAW files.

Since you ran a WIC diagnosis, you know how fast LibRaw loads your files. And IMatch loads many files in parallel when it indexes images (depending on how many CPU cores your system has and if the SSD handles it).

You can select portrait files easily with the Filter Panel: Orientation and Dimension filter.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

ChicagoGhost

Quote from: Mario on November 06, 2024, 08:18:14 AMYou can select portrait files easily with the Filter Panel: Orientation and Dimension filter.
This filter doesn't work on my CR2 files.
Even after I updated all files with the "Prefer photools.com RAW processing" set to "Yes", and all files are displayed in the correct orientation, the filter still can't filter out portrait photos.
It works on JPG files though.

JohnZeman

Just as an aside...

In regards to the orientation issue I had this problem with photos taken by some camera apps on my iPhone.

At the time to get around the problem I virtually rotated the images in IMatch.

The problem turned out to be the camera app, not IMatch, which the camera app developers eventually corrected and now all is ok again.

Mario

Quote from: ChicagoGhost on November 07, 2024, 01:37:27 AM
Quote from: Mario on November 06, 2024, 08:18:14 AMYou can select portrait files easily with the Filter Panel: Orientation and Dimension filter.
This filter doesn't work on my CR2 files.
Even after I updated all files with the "Prefer photools.com RAW processing" set to "Yes", and all files are displayed in the correct orientation, the filter still can't filter out portrait photos.
It works on JPG files though.

Not sure how this can happen. The filter looks at the reported width / height of the image in the database.
What do the variables {File.Width} and {File.Height} show for files where the filter does not catch it?
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Mario

Quote from: JohnZeman on November 07, 2024, 04:30:05 AMThe problem turned out to be the camera app, not IMatch, which the camera app developers eventually corrected and now all is ok again.
IMatch just asks WIC or LibRaw how to rotate the image returned, and then does it.
It has no further information about the actual rotation of the data in the image.

If the embedded preview has not been saved in normal orientation but the camera did not log that in the EXIF orientation tag for the preview, there is no way to tell.

There can be up to 3 images in a RAW file (thumbnail, preview, RAW data) and, in theory, each can have a different orientation. IMatch loads the embedded preview and when this is not large enough, it loads the RAW image. It asks WIC/LibRaw how to rotate the image and then applies that orientation. IMatch cannot tell if the reported orientation is wrong.

As you said, a virtual rotation fixes the problem.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

ChicagoGhost

Quote from: Mario on November 07, 2024, 08:41:00 AMNot sure how this can happen. The filter looks at the reported width / height of the image in the database.
What do the variables {File.Width} and {File.Height} show for files where the filter does not catch it?
I just tried it on another computer.
Everything works correctly!
So strange!
The photos that were displayed in the wrong orientation now are shown correctly (with the "Prefer photools.com RAW processing" set to the default value: "No").
The "Orientation and Dimension" filter can correctly filter out portrait photos.
The reported {File.Width} value is smaller than {File.Height} value for portrait photos.

The computer I am using now runs Win10, the one before runs Win11.
I don't know whether that makes any difference for IMatch.
However, on both computers, in Windows File Explorer, the photo orientations are correct.
I will check later what the {File.Width} and {File.Height} values are on the other computer.

Mario

Windows Explorer may only use the thumbnail, not the preview or RAW image! Which can make a big difference.
IMatch is build and tested on Windows 11, with regular tests on W10 to ensure compatibility.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

ChicagoGhost

On the first computer, {File.Width} value is LARGER than {File.Height} value for portrait photos.
Hence it is not recognized as a portrait photo.

I tried this on another computer running Win10. No problem.

So I have tried this on three computers, and on two of them (Win10), the photos are shown in the correct orientations.
On another one running Win11, the portrait photos are shown in the wrong orientations.
Maybe this has nothing to do with the Windows version.
Maybe I messed up something related to WIC in the Windows system?

BTW, I tried with the same photos on all computers.

Rene Toepfer

Quote from: ChicagoGhost on November 01, 2024, 02:50:41 AMIMatch displays my RAW photos (CR2 files, which were shot in portrait mode) in the wrong orientation. They are displayed in landscape mode. JPG files are fine.
There are no sidecar files to these photos.
They are displayed in the correct orientation in Lightroom or Windows File Explorer.
It needs a lot of work to manually rotate them one by one.
I have the same issue with my Sony ARW (Alpha 7RIV) since a few weeks. iPhone 16 Pro Max and Google Pixel 8 Pro DNG will also not be shown in correct orientation. Currently I select them manually and rotate them. The proposed filter does not work.
I run IM on Windows 11 Pro.

Mario

QuoteI have the same issue with my Sony ARW (Alpha 7RIV) since a few weeks.
Since the last IMatch 2023 release is a couple of months old, what has changed on your system?
New firmware installed in the cameras?
Have you tried WIC and LibRaw?
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Rene Toepfer

Quote from: Mario on November 08, 2024, 08:18:52 AMSince the last IMatch 2023 release is a couple of months old, what has changed on your system?
The usual auto updates.

Quote from: Mario on November 08, 2024, 08:18:52 AMNew firmware installed in the cameras?
No

Quote from: Mario on November 08, 2024, 08:18:52 AMHave you tried WIC and LibRaw?

Yes, by WIC was set NO. The change to YES and forced rescan resulted in correct orientated images. Tested with Sony ARW and Apple iPhone 16 DNG.


Mario

There is no "by WIC" setting. Do you mean "Prefer photools.com RAW Processing" in Edit > Preferences > Application?
If this is "Yes", IMatch ignores WIC codecs (except as a fall-back) and processes files with LibRaw.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Rene Toepfer

Quote from: Mario on November 10, 2024, 11:09:40 AMDo you mean "Prefer photools.com RAW Processing" in Edit > Preferences > Application?
I meant Edit > Preferences > Application. "Rotate embedded preview (WIC)" was set NO. Since I have changed it to YES and did a forced rescan, it works as expected.

Mario

This is a "last-resort" override, forcing IMatch to rotate the embedded preview based on the EXIF orientation reported by the RAW data. Since the embedded preview is supposed to be oriented "normal" (no rotation required), this means that the previews in your images don#t follow the convention.

WIC/ExifTool report "do not rotate" to IMatch and thus IMatch does not. Your setting forces IMatch to ignore the orientation reported by LibRaw/WIC and use the orientation of the RAW data for the preview.
IMatch can only see what LibRaw/WIC tell it. It cannot know that the preview was not rotated correctly.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook