pedrocr / rawloader

rust library to extract the raw data and some metadata from digital camera images
GNU Lesser General Public License v2.1
314 stars 54 forks source link

Some images with ambiguous orientation data are not rotated correctly #4

Open runfalk opened 7 years ago

runfalk commented 7 years ago

Some image formats contain orientation information in the Makernote tag. Here's one example where the normal Orientation tag doesn't match the one in the Makernote:

https://raw.pixls.us/getfile.php/346/nice/Sony%20-%20SLT-A99%20-%2014bit%20(3:2).ARW https://raw.pixls.us/getfile.php/346/exif/RAW_SONY_SLT-A99V.ARW.exif.txt

Exiftool outputs the following data where 270 CW is correct:

0x0112 Orientation                     : Rotate 180
0x0028 Camera Orientation              : Rotate 270 CW

The CameraOrientation tag for this particular image is within Tag9400a (0x9400) in the Makernote. According to http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Sony.html there are many different places where orientation can be stored.