Bug 289181 - raw processor rotates images without Orientation EXIF tag
Summary: raw processor rotates images without Orientation EXIF tag
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: BatchQueueManager-RAWProcessing (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-17 11:11 UTC by _kfj
Modified: 2017-06-30 08:17 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.0.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description _kfj 2011-12-17 11:11:00 UTC
Version:           1.9.0 (using KDE 4.6.5) 
OS:                Linux

When I turn off autorotate on my EOS 450D and take portrait shots, the resulting CR2 files have the EXIF 'Orientation' tag set to 'Horizontal' and the EXIF 'Camera Orientation' tag set to Rotate 90 CW or 270 CW. When converting these images to TIFF with digiKam's batch processor, the resulting images are rotated per 'Camera Orientation' tag. This should only happen when the 'Orientation' tag is also set (so, when the images are taken with the Camera set to autorotate).

I doublechecked this behaviour against Canon's raw processor, raw therapee and dcraw; they all perform as I expect and do not rotate these images.

Reproducible: Always

Steps to Reproduce:
feed an image with EXIF 'Orientation' tag Horizontal and 'Camera Orientation' tag 'Rotate 90 CW' into digikam's batch raw processor

convert to TIFF

Actual Results:  
the resulting image is rotated, even though it shouldn't be

Expected Results:  
the image should not be rotated

Camera Orientation is AFAIK a maker-specific tag. It is correctly propagated into the TIFF files, but when the general EXIF 'Orientation' tag isn't set, it should not have any effect upon the conversion; the data should just be converted in sensor geometry and show up landscape just as the sensor received them.
Comment 1 caulier.gilles 2011-12-17 11:52:22 UTC
Try with kipi-plugins/digiKam 2.4... 1.9.0 is pretty old now...

Gilles Caulier
Comment 2 _kfj 2011-12-17 21:53:21 UTC
Am 17.12.2011 12:52, schrieb Gilles Caulier:
> https://bugs.kde.org/show_bug.cgi?id=289181
>
>
> Gilles Caulier<caulier.gilles@gmail.com>  changed:
>
>             What    |Removed                     |Added
> ----------------------------------------------------------------------------
>               Status|UNCONFIRMED                 |RESOLVED
>                   CC|                            |caulier.gilles@gmail.com
>           Resolution|                            |WAITINGFORINFO
>
>
>
>
> --- Comment #1 from Gilles Caulier<caulier gilles gmail com>   2011-12-17 11:52:22 ---
> Try with kipi-plugins/digiKam 2.4... 1.9.0 is pretty old now...

I'm on Kubuntu 11.4. There is no newer packet than 1.9.0
are you positive this has been fixed?

Kay
Comment 3 caulier.gilles 2011-12-17 22:10:03 UTC
Well, i cannot reproduce it, but it's better to see report author confirm it.

Gilles Caulier
Comment 4 _kfj 2011-12-17 22:17:46 UTC
Am 17.12.2011 23:10, schrieb Gilles Caulier:
> https://bugs.kde.org/show_bug.cgi?id=289181
>
>
> Gilles Caulier<caulier.gilles@gmail.com>  changed:
>
>             What    |Removed                     |Added
> ----------------------------------------------------------------------------
>               Status|RESOLVED                    |UNCONFIRMED
>           Resolution|WAITINGFORINFO              |
>
>
>
>
> --- Comment #3 from Gilles Caulier<caulier gilles gmail com>   2011-12-17 22:10:03 ---
> Well, i cannot reproduce it, but it's better to see report author confirm it.
>
> Gilles Caulier
>
would it help you to reproduce it if I provide sample data?

Kay
Comment 5 caulier.gilles 2011-12-17 22:21:19 UTC
yes, sure

Gilles Caulier
Comment 6 _kfj 2011-12-17 22:49:54 UTC
Am 17.12.2011 23:21, schrieb Gilles Caulier:
> https://bugs.kde.org/show_bug.cgi?id=289181
>
>
>
>
>
> --- Comment #5 from Gilles Caulier<caulier gilles gmail com>   2011-12-17 22:21:19 ---
> yes, sure
>
> Gilles Caulier
>
the original raw file has these tags:

kfj@Anja:/media/Space/Bilder/work$ exiftool  -Orientation 
-CameraOrientation IMG_3932.CR2
Orientation                     : Horizontal (normal)
Camera Orientation              : Rotate 270 CW

but when converted, it's rotated. The tags in the TIFF are the same.

the comparison is in this screenshot:

http://dl.dropbox.com/u/52145569/misconverted.jpg

and if you want the raw file it's

http://dl.dropbox.com/u/52145569/IMG_3932.CR2

but it'll take a while to show up there since my uplink is slow

Kay
Comment 7 caulier.gilles 2011-12-18 09:19:39 UTC
Ok, i tested result here with your image : It's the same in icon view.

I tested with my Sony DLSR, it's the same with device autorotation settings.

The problem is not with RAW converter. Look in metadata TIFF orientation tag is the same  than CR2. If you disable thumb autorotate option from digiKam/metadta config dialog, TIFF will not be rotated

The problem is about RAW preview image where we don't have any relevant information about rotation angle. The real image rotation information is not the same. It'is issue,s a big puzzle.

The RAW preview is not taken from RAW data. It's an embedded JPEG image in RAW file. And orientation of this preview is not the same than RAW image, due to your change of your camera orientation settings.

To solve this issue digiKam must be able to rotate thumbs independently of real image data. There is already a report in digiKam bugzilla about this subject...
Comment 8 _kfj 2011-12-18 13:13:59 UTC
Am 18.12.2011 10:19, schrieb Gilles Caulier:

> The problem is not with RAW converter. Look in metadata TIFF orientation tag is
> the same  than CR2. If you disable thumb autorotate option from digiKam/metadta
> config dialog, TIFF will not be rotated

this is not so, at least not on my system. AFAIKT the raw processor here 
ignores the 'Orientation' tag and rotates according to the 'Camera 
Orientation' tag. Please note that my problem is that the image IS 
rotated, but I want it NOT to be rotated, this is why I have set the 
'Orientation' tag to 'Horizontal'. And my issue is with the resulting 
TIFF file, not with the CR2 or it's display in digiKam.

In hugin-ptx, where I am discussing the issue, I've been told that there 
were versions of dcraw which exhibited this bug, so I suppose that's 
what my problem is here.

Of course it's possible that with your later version of the raw 
converter, the bug has been fixed already on your system.

> The problem is about RAW preview image where we don't have any relevant
> information about rotation angle. The real image rotation information is not
> the same. It'is issue,s a big puzzle.

the preview file will be rotated if autorotate is set in the camera, 
otherwise it's not. I've checked by extracting the embedded JPG with 
dcraw -e.

> The RAW preview is not taken from RAW data. It's an embedded JPEG image in RAW
> file. And orientation of this preview is not the same than RAW image, due to
> your change of your camera orientation settings.
>
> To solve this issue digiKam must be able to rotate thumbs independently of real
> image data. There is already a report in digiKam bugzilla about this subject...

my problem isn't with the embedded thumbnail images. I process the data 
with hugin to make panoramas and I have a pretty good idea how to tell 
rotated image data from unrotated data. I need all the image data as it 
hit the sensor. dcraw, DPP and raw therapee all perform as I expect on 
this system. digiKam does not. Be assured the problem exists and has 
nothing to do with thumbnails or digiKam's thumbnail display.

Kay
Comment 9 Marcel Wiesweg 2011-12-26 11:22:17 UTC
I'm not quite sure which part is reading the CameraOrientation tag. It's a makernote tag, and I dont see it mentionen in libkexiv2.

This bug is about the preview or the main image? I'm not quite sure after reading all the comments.
Comment 10 _kfj 2011-12-26 11:35:27 UTC
Am 26.12.2011 12:22, schrieb Marcel Wiesweg:
> https://bugs.kde.org/show_bug.cgi?id=289181
>
>
>
>
>
> --- Comment #9 from Marcel Wiesweg<marcel wiesweg gmx de>   2011-12-26 11:22:17 ---
> I'm not quite sure which part is reading the CameraOrientation tag. It's a
> makernote tag, and I dont see it mentionen in libkexiv2.
>
> This bug is about the preview or the main image? I'm not quite sure after
> reading all the comments.
>
the bug is about handling of image data in the raw batch processing 
module of digiKam. Images which have the Orientation tag set to 
'horizontal' (and should therefore not be rotated) are nevertheless 
rotated if the CameraOrientation tag is not set to 'horizontal'.
Comment 11 caulier.gilles 2011-12-26 12:37:04 UTC
In RAW Import tool, Libraw check exif orientation flag. This is why in image editor i have disabled auto-rotation provided by libkexiv2 with RAW files.

Gilles Caulier
Comment 12 caulier.gilles 2015-05-19 08:42:56 UTC
Kfj,

This file still valid using last kipi-plugins 4.10.0 ?

Gilles Caulier
Comment 13 caulier.gilles 2015-06-29 17:52:40 UTC
New Kipiplugins 4.11.0 is available :

https://www.digikam.org/node/740

Can you reproduce the problem with this release ?

Gilles Caulier
Comment 14 caulier.gilles 2015-07-04 10:23:05 UTC
RawConverter is not maintained since a while and is obsolete now. It will
be removed with 5.0.0.

Use digiKam BQM instead...