RT Misreading Image Orientation

(Roman Huerta) #1

I am using RT for image processing, but for some reason I am getting images where the orientation is incorrectly set and exported. This means the images are rotated incorrectly, and even when I try to rotate them, when exporting, the images remain incorrectly oriented.

The Exif metadata says its is 8688 x 5792, but on the images it says 5792 x 8688.

So it displays and exports the images as portrait, and NOT as the original landscape.

I have no idea why this is happening and it is a big problem when batch processing in the command-line in RT.

Please help, much thanks,


(Morgan Hardwood) #2



  • You’re looking at the wrong tag, you should be looking at tag 0x0112 Orientation
  • Editing MakerNotes is dangerous.
  • Orientation sensors in cameras which are pointed down return fuzzy orientations.

(Ingo Weyrich) #3

The orientation sensor of your camera obviously fails in this case.

The values (width and height) are perfectly fine

Use these buttons to rotate the image in case the orientation sensor fails.

Btw: I was told that the orientation sensor of some Canon cameras sometimes gives wrong orientation information even if it’s disabled.

(Roman Huerta) #4

Thanks for getting back to me. I apologize, but I was out of town this week and was unable to reply. I just looked up the tags you mentioned in exiftool, and it says that my images have normal orientations:

These images are .cr2 files. If you’re aware of anything else I could try, I’d really appreciate it!

(Morgan Hardwood) #5

Please upload a sample image where orientation is correct and one where it is incorrect using https://filebin.net/

(Roman Huerta) #6

Thanks for your quick reply. I can’t access filebin.net at work, so I uploaded the images to Google Drive instead. I hope that is okay. You should be able to access the folder even if you don’t have a Google account.


The output images (where the issue is seen) are .jpgs. I also included the LR .pp3 files with the original .cr2 images (in the input folder). The image with the wrong orientation is 002045-1004171644338-Cam1, and the image with the correct orientation is 002795-1004171720095-Cam1.

Muchas gracias,


(Morgan Hardwood) #7

@rehuerta I will try to look at them over the weekend. Before I do, tell me, have you manipulated them in any way? e.g. have you rotated them in-camera after shooting, or rotated them on your computer?

(Ingo Weyrich) #8

@rehuerta The jpegs embedded in the raw files have different orientation too (one is portrait and the other one is landscape orientation)

(Roman Huerta) #9

I don’t believe they were rotated in-camera or on a computer, but I understand that they were georeferenced and converted to .cr2 from another format (I believe a pure raw format). Lighting adjustment is one of many steps in our workflow (not the first step), and we’re hoping to use RawTherapee to replace Lightroom, but Lightroom doesn’t have this orientation issue. The camera was a Canon EOS 5DS. Hope this helps!

(Roman Huerta) #11

I have been figuring out ExifTool and it seems to be working well, and I have figured out how to adjust the image’s and the thumbnail’s orientation. But in response to @heckflosse possible solution, I have not seen how to change the embedded JPG’s orientation within a CR2 image.

Would you know the cmd ExifTools tags for retrieving and changing the embedded JPG orientation EXIF data for CR2’s?


(Glenn Butcher) #12

For what it’s worth, while working orientation behavior in my software, I found this set of images that were very useful in validating my code:

(Roman Huerta) #13

@heckflosse How did you check the orientation of the embedded jpegs? I have been trying to find this function through ExifTool, but I have had not luck.

I have used this: exiftool -RawJpgInfo -RawJpgSize *.cr2 but nothing seems to come up.

Muchas gracias in advanced

(Ingo Weyrich) #14

This is very interesting

(Roman Huerta) #15

@heckflosse This is fantastic! Thank you so much.

I applied the patch to the RT code which I have downloaded from the RT Git.

I am almost there, I just need to build the code, but Cmake will not build the RT code (I do have Visual Studios installed). I am hoping you would be able to send me an executable file, or help me understand the best way to build the RT code.

Muchas gracias for all you help.


(Ingo Weyrich) #16

@rehuerta You may need to clear the cache because it contains the old orientation.

Edit: Compilation instructions for Windows are here

As a benefit you will also get faster processing when you build RT yourself :slight_smile:

Don’t hesitate to ask in case of problems, though preferably in a different topic or in pm




uploaded at

Even if I provide a build, I encourage you to build yourself. Follow instructions carefully and you are welcome to ask for help if needed.

(Roman Huerta) #18

@heckflosse and @gaaned92,

Thanks a million for your help! I was able to build RT and the fix worked flawlessly!

Muchas Gracias!