Exif orientation flags

Hi All! I’m new to RawTherapee, and it seems awesome. I’m hoping to use it to help with my astrophotography workflow.

I have an odd problem though; I batch-process a large number of images, with different orientations (because of the way the camera tracks night-sky objects). I use ‘exiftool’ to set all the orientation flags to ‘Horizontal’ - and this seems to work fine for Photoshop etc. But in RawTherapee, the RAW images still have their original (mixed) orientations! Also no orientation flags appear in the ‘Meta’ tab for the images.

I did view the RAW images in RawTherapee before resetting the orientation flags - could RawTherapee have cached the metadata flags somewhere? (I’ve cleared out the RTCache folder). How does RawTherapee work out the orientation, and why doesn’t it show the flags in the ‘Meta’ tab?

Many thanks for your thoughts!
-Mat

I should probably add that these are Sony ARW raw images!

What happens if you select the default processing profile again in RT?

Once you open each image in the editor in RT, it saves a sidecar file with the settings from then. Subsequently, even if you change the exif orientation in the raw, it’ll ignore that and process based on the sidecar file.

Thanks CarVac, resetting to the default processing profile doesn’t seem to help. Also I deleted all the sidecar files, and that didn’t help either!
Cheers
-Mat

Can you provide two raw files (one with correct orientation and the other one with incorrect orientation)?
Please provide the exact exiftool command you used to set the orientation.
Then we can test and possibly provide a solution.

Many thanks heckflosse, here’s a link to two images, the first appears horizontally, the second appears vertically. They both seem to have the same exif flags. They were processed with the command line below.

exiftool -a -G1 -orientation=Horizontal -cameraorientation=Horizontal -rotation=Horizontal -overwrite_original *.arw

A couple of things that may (or may not) help…

I’m not sure what the -rotation tag is. It doesn’t appear in the exiftool docs that could find?

Why are you changing the camera orientation also? Was the camera actually vertical or horizontal? I’d leave this alone. The reason is that the orientation tag I think is just an integer for rotating the image relative to the camera orientation. I haven’t checked this yet, but I have a sneaking suspicion…

Could you output what those two fields are set to in an unadulterated pair of images (horiz and vert orientation) straight out of the camera?

Many thanks patdavid. The images are taken as the camera rotates on a mount, so I end up with both vertical and horizontal orientations.

I found that command-line elsewhere on the web - so I’m not sure about those specific tags.

Here’s a diff of two original images with different orientations:

And here’s a diff of two ‘fixed’ images, which appear to have the same rotation flags, but appear with different rotations in RawTherapee:

Thanks
-Mat

Valid values for the 0x0112 “Orientation” tag are:

1 = Horizontal (normal) 
2 = Mirror horizontal 
3 = Rotate 180 
4 = Mirror vertical 
5 = Mirror horizontal and rotate 270 CW 
6 = Rotate 90 CW 
7 = Mirror horizontal and rotate 90 CW 
8 = Rotate 270 CW

IFD0 is the main image, IFD1 is the thumbnail.

Both of your “main images” are horizontal

exiftool -G1 -a -H -Orientation -CameraOrientation DSC*
======== DSC08885.ARW
[IFD0]          0x0112 Orientation                     : Horizontal (normal)
[IFD1]          0x0112 Orientation                     : Horizontal (normal)
[Sony]          0x0029 Camera Orientation              : Horizontal (normal)
======== DSC09239.ARW
[IFD0]          0x0112 Orientation                     : Horizontal (normal)
[IFD1]          0x0112 Orientation                     : Rotate 270 CW
[Sony]          0x0029 Camera Orientation              : Horizontal (normal)
exiftool -G1 -a -H -n -Orientation -CameraOrientation DSC*
======== DSC08885.ARW
[IFD0]          0x0112 Orientation                     : 1
[IFD1]          0x0112 Orientation                     : 1
[Sony]          0x0029 Camera Orientation              : 1
======== DSC09239.ARW
[IFD0]          0x0112 Orientation                     : 1
[IFD1]          0x0112 Orientation                     : 8
[Sony]          0x0029 Camera Orientation              : 1

RawTherapee therefore appears to be using the IFD1 Orientation tag instead of the IFD0 one.

If you do not specify which IFD to edit, ExifTool will edit IFD0 by default, which leaves you with a thumbnail whose orientation does not match the main image.

To rotate both the thumbnail and the main image:

exiftool -overwrite_original -n -IFD0:Orientation="1" -IFD1:Orientation="1" *.ARW

Clear the cache while RawTherapee is closed so that the thumbnails will be regenerated.

3 Likes

Morgan, I can confirm that worked perfectly - all images are now correct. Thank you for your expertise!
Kind regards
-Mat