Rotation issue in image view

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

Rotation issue in image view

Arnd Baecker
Moin,

there is subtle rotation issue with current svn:

   - start a fresh digikam
   - consider an portrait image
    (where this information is still in the
     exif, so that it requires auto-rotation)
   - view image (F3) - all ok
   - go back to the album view (ESC or mouse-click)
   - open this image in the image editor (F4)
   - and quit immediately (CTRL-q)
   - view image (F3)
     Surprise: it is rotated!

This appears to be a caching issue ...
(I hope it is faster to fix than it took me
to figure out a reproducable way for this effect ;-)

I did not find a bug report to which I could attach
this (don't think that this would belong to
https://bugs.kde.org/show_bug.cgi?id=141774).
Should I file a new bug report?

Best, Arnd


_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

Re: Rotation issue in image view

Gilles Caulier-4
Right. I can reproduce it. It's a cache problem. The cache image fingerprint is certainly the same between preview image and full version of image. The fingerprint must be different in this case.
 
The B.K.O file #141774 is another subject. Please open new file (excepted if Marcel can fix it before 0.9.1 final release (:=)))
 
Gilles Caulier

 
2007/3/2, Arnd Baecker <[hidden email]>:
Moin,

there is subtle rotation issue with current svn:

  - start a fresh digikam
  - consider an portrait image
   (where this information is still in the
    exif, so that it requires auto-rotation)
  - view image (F3) - all ok
  - go back to the album view (ESC or mouse-click)
  - open this image in the image editor (F4)
  - and quit immediately (CTRL-q)
  - view image (F3)
    Surprise: it is rotated!

This appears to be a caching issue ...
(I hope it is faster to fix than it took me
to figure out a reproducable way for this effect ;-)

I did not find a bug report to which I could attach
this (don't think that this would belong to
https://bugs.kde.org/show_bug.cgi?id=141774).
Should I file a new bug report?

Best, Arnd


_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel


_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

Re: Rotation issue in image view

Marcel Wiesweg
In reply to this post by Arnd Baecker
> Moin,
>
> there is subtle rotation issue with current svn:
>
>    - start a fresh digikam
>    - consider an portrait image
>     (where this information is still in the
>      exif, so that it requires auto-rotation)
>    - view image (F3) - all ok

What is "all ok"? Should it be rotated or not? What options have you set?

>    - go back to the album view (ESC or mouse-click)
>    - open this image in the image editor (F4)
>    - and quit immediately (CTRL-q)
>    - view image (F3)
>      Surprise: it is rotated!

Why should it not be rotated? Or is is rotated twice?

>
> This appears to be a caching issue ...

When loading a preview, the cache is searched in this order:
1. Full image
2. Preview image

This means if the Image Editor has loaded a full version, it will later on be
preferred over the preview version, when loading a preview. Can this explain
the behavior?

It must never happen that when loading a full version, the reduced version is
returned.


> (I hope it is faster to fix than it took me
> to figure out a reproducable way for this effect ;-)
>
> I did not find a bug report to which I could attach
> this (don't think that this would belong to
> https://bugs.kde.org/show_bug.cgi?id=141774).
> Should I file a new bug report?
>
> Best, Arnd
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

Re: Rotation issue in image view

Gilles Caulier-4
Marcel, i can reproduce the problem with the RC1 code (available on my computer). Perhaps have you fixed this problem later RC1.
 
You can see the difference when you play with RAW image using preview mode and image editor. try to use a vertical RAW picture from my repository :
 
 
Gilles

 
2007/3/4, Marcel Wiesweg <[hidden email]>:
> Moin,
>
> there is subtle rotation issue with current svn:
>
>    - start a fresh digikam
>    - consider an portrait image
>     (where this information is still in the
>      exif, so that it requires auto-rotation)
>    - view image (F3) - all ok

What is "all ok"? Should it be rotated or not? What options have you set?

>    - go back to the album view (ESC or mouse-click)
>    - open this image in the image editor (F4)
>    - and quit immediately (CTRL-q)
>    - view image (F3)
>      Surprise: it is rotated!

Why should it not be rotated? Or is is rotated twice?

>
> This appears to be a caching issue ...

When loading a preview, the cache is searched in this order:
1. Full image
2. Preview image

This means if the Image Editor has loaded a full version, it will later on be
preferred over the preview version, when loading a preview. Can this explain
the behavior?

It must never happen that when loading a full version, the reduced version is
returned.


> (I hope it is faster to fix than it took me
> to figure out a reproducable way for this effect ;-)
>
> I did not find a bug report to which I could attach
> this (don't think that this would belong to
> https://bugs.kde.org/show_bug.cgi?id=141774).
> Should I file a new bug report?
>
> Best, Arnd
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel


_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

Re: Rotation issue in image view

Arnd Baecker
In reply to this post by Marcel Wiesweg
On Sun, 4 Mar 2007, Marcel Wiesweg wrote:

> > Moin,
> >
> > there is subtle rotation issue with current svn:
> >
> >    - start a fresh digikam
> >    - consider an portrait image
> >     (where this information is still in the
> >      exif, so that it requires auto-rotation)
> >    - view image (F3) - all ok
>
> What is "all ok"? Should it be rotated or not?

"all ok" should mean that for a portrait shot,
the picture gets automatically rotatated according
to the exif info (so that on screen a person's feet are
pointing downwards).
(Hope this is clearer, don't hesitate to ask!!!)

> What options have you set?

Sorry, which options, where?

> >    - go back to the album view (ESC or mouse-click)
> >    - open this image in the image editor (F4)
> >    - and quit immediately (CTRL-q)
> >    - view image (F3)
> >      Surprise: it is rotated!
>
> Why should it not be rotated? Or is is rotated twice?

Oh, sorry, I see the possiblity of mis-understanding
with all the rotations;-):
it is rotated wrt the "all ok" above, so it
is "not ok"  (in a sense it is not rotated properly
according to the exif info, i.e. a person's feet
are not pointing downwards but either to the left or right).

It is quite hard to explain, do you have
a picture like that to try it out?

Best, Arnd
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

Re: Rotation issue in image view

Marcel Wiesweg
In reply to this post by Marcel Wiesweg

Ok, the problem is simple:
Previews are rotated in the loading thread, before they are put in the cache.
Full version are rotated by DImgInterface, after they are put in the cache.
(There is a comment that dcraw automatically rotates the images, but that does
not hold for previews?)
So if the preview uses the full version, it is not rotated.

Marcel
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

Re: Rotation issue in image view

Gilles Caulier-4
Marcel,

There is a _very_ important things to understand about RAW files :

Preview  != full image !

...of course about the image data, the image size, etc, but also about
the rotation flag.

RAW file is a contatiner witch include the CCD RAW camera data and a
preview image (generally a JPEG image) witch is used by camera to
render on a screen tv (for example)

The preview orientation can be completly different of RAW image data !
This is depending of how the camera orientation flag have be set by
user after the shot (for example to render the picture to the small
screen of camera)

This way how is handle RAW pictures and preview suck roally, but we
must drive it as well.

This why it's wrong to use the Exif orientation tags with RAW preview.
This tags is right with the full RAW image, not the preview image.

Gilles


2007/3/5, Marcel Wiesweg <[hidden email]>:

>
> Ok, the problem is simple:
> Previews are rotated in the loading thread, before they are put in the
> cache.
> Full version are rotated by DImgInterface, after they are put in the cache.
> (There is a comment that dcraw automatically rotates the images, but that
> does
> not hold for previews?)
> So if the preview uses the full version, it is not rotated.
>
> Marcel
> _______________________________________________
> Digikam-devel mailing list
> [hidden email]
> https://mail.kde.org/mailman/listinfo/digikam-devel
>
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

Re: Rotation issue in image view

Bugzilla from ach@mpe.mpg.de
On Monday, 5. March 2007, Gilles Caulier wrote:

> Marcel,
>
> There is a _very_ important things to understand about RAW files :
>
> Preview  != full image !
>
> ...of course about the image data, the image size, etc, but also about
> the rotation flag.
>
> RAW file is a contatiner witch include the CCD RAW camera data and a
> preview image (generally a JPEG image) witch is used by camera to
> render on a screen tv (for example)
>
> The preview orientation can be completly different of RAW image data !
> This is depending of how the camera orientation flag have be set by
> user after the shot (for example to render the picture to the small
> screen of camera)
>
> This way how is handle RAW pictures and preview suck roally, but we
> must drive it as well.
>
> This why it's wrong to use the Exif orientation tags with RAW preview.
> This tags is right with the full RAW image, not the preview image.

Does it make sense to add a save guard here?  Like x/y of full image
!= x/y of thumbnail  ==> present a dialog with once left and once right
rotated.  User clicks one one of them and the corrected preview get's
saved?

Achim

>
> Gilles
>
>
> 2007/3/5, Marcel Wiesweg <[hidden email]>:
> >
> > Ok, the problem is simple:
> > Previews are rotated in the loading thread, before they are put in the
> > cache.
> > Full version are rotated by DImgInterface, after they are put in the cache.
> > (There is a comment that dcraw automatically rotates the images, but that
> > does
> > not hold for previews?)
> > So if the preview uses the full version, it is not rotated.
> >
> > Marcel
> > _______________________________________________
> > Digikam-devel mailing list
> > [hidden email]
> > https://mail.kde.org/mailman/listinfo/digikam-devel
> >
> _______________________________________________
> Digikam-devel mailing list
> [hidden email]
> https://mail.kde.org/mailman/listinfo/digikam-devel
>
>



--
  To me vi is Zen.  To use vi is to practice zen. Every command is
  a koan. Profound to the user, unintelligible to the uninitiated.
  You discover truth everytime you use it.
                                      -- [hidden email]
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

Re: Rotation issue in image view

Marcel Wiesweg
In reply to this post by Gilles Caulier-4
I have now fixed the bug in SVN: If a full version is taken from the cache, it
is rotated.
But, to be faster (scaling!), if there is a preview version as well, it is
preferred.

> The preview orientation can be completly different of RAW image data !
> This is depending of how the camera orientation flag have be set by
> user after the shot (for example to render the picture to the small
> screen of camera)
>
> This way how is handle RAW pictures and preview suck roally, but we
> must drive it as well.
>
> This why it's wrong to use the Exif orientation tags with RAW preview.
> This tags is right with the full RAW image, not the preview image.

So what can we do about this?
See bug 131603: For some RAW files, the tag is correct.

Are there raw file formats for which the preview orientation is always right
or wrong? Or do different camera models, using the same format, do this
differently?

Looking at the sample images from the repository, there are at least four
groups:

a) Correct in thumbnail, correct in preview, correct in full version
        6057_009.cr2
        DSC0028.arw
        DSC_2162.nef
        L1000877.DNG
        MINOLTA-DYNAX5D-01.MRW
        k10d.dng
b) Correct in thumbnail, correct in preview, _wrong_ in full version
        MINOLTA-DYNAX5D-03.MRW
        MINOLTA-DYNAX5D-04.MRW
c) Wrong (180°) in thumbnail, wrong (180°) in preview, correct in full version
        Canon-G5.crw
d) Wrong in thumbnail, wrong in preview, wrong in full version
        DSCF0019.raf
        S9500-vert.raf
        S9600-vert.raf

For case d) there is apparently no information about orientation. Or is this a
feature of .RAF files?
For case c), there is, but why is it 180° wrong? Seems to be .crw specific.
Case b), I dont know.
Case a) is fortunately the largest group.

Marcel
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

Re: Rotation issue in image view

Bugzilla from ahuggel@gmx.net
On Sunday 11 March 2007 01:09, Marcel Wiesweg wrote:

>
> Looking at the sample images from the repository, there are at least
> four groups:
>
> a) Correct in thumbnail, correct in preview, correct in full version
> 6057_009.cr2
> DSC0028.arw
> DSC_2162.nef
> L1000877.DNG
> MINOLTA-DYNAX5D-01.MRW
> k10d.dng
> b) Correct in thumbnail, correct in preview, _wrong_ in full version
> MINOLTA-DYNAX5D-03.MRW
> MINOLTA-DYNAX5D-04.MRW
> c) Wrong (180°) in thumbnail, wrong (180°) in preview, correct in
> full version Canon-G5.crw
> d) Wrong in thumbnail, wrong in preview, wrong in full version
> DSCF0019.raf
> S9500-vert.raf
> S9600-vert.raf

Great summary. Just to be sure: is this about the correctness of the
Exif tag Exif.Image.Orientation, which digikam gets from Exiv2?

(There is a related discussion in the Exiv2 group about whether the tag
for CRWs is correct:
http://uk.groups.yahoo.com/group/exiv2/message/660)

-ahu.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

Re: Rotation issue in image view

Gilles Caulier-4
I  have talk with Marcel, yesterday by IRC. This report is not valid because he have used an old Exiv2 release.

Here on my computer, the result is different, especially with al MRW files (taken with my camera)

Gilles


2007/3/11, Andreas Huggel <[hidden email]>:
On Sunday 11 March 2007 01:09, Marcel Wiesweg wrote:

>
> Looking at the sample images from the repository, there are at least
> four groups:
>
> a) Correct in thumbnail, correct in preview, correct in full version
>       6057_009.cr2
>       DSC0028.arw
>       DSC_2162.nef
>       L1000877.DNG
>       MINOLTA-DYNAX5D-01.MRW
>       k10d.dng
> b) Correct in thumbnail, correct in preview, _wrong_ in full version
>       MINOLTA-DYNAX5D-03.MRW
>       MINOLTA-DYNAX5D-04.MRW
> c) Wrong (180°) in thumbnail, wrong (180°) in preview, correct in
> full version Canon-G5.crw
> d) Wrong in thumbnail, wrong in preview, wrong in full version
>       DSCF0019.raf
>       S9500-vert.raf
>       S9600-vert.raf

Great summary. Just to be sure: is this about the correctness of the
Exif tag Exif.Image.Orientation, which digikam gets from Exiv2?

(There is a related discussion in the Exiv2 group about whether the tag
for CRWs is correct:
http://uk.groups.yahoo.com/group/exiv2/message/660 )

-ahu.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel


_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

Re: Rotation issue in image view

Marcel Wiesweg
In reply to this post by Marcel Wiesweg
> a) Correct in thumbnail, correct in preview, correct in full version
> 6057_009.cr2
> DSC0028.arw
> DSC_2162.nef
> L1000877.DNG
> MINOLTA-DYNAX5D-01.MRW
> k10d.dng
> b) Correct in thumbnail, correct in preview, _wrong_ in full version
> MINOLTA-DYNAX5D-03.MRW
> MINOLTA-DYNAX5D-04.MRW
> c) Wrong (180°) in thumbnail, wrong (180°) in preview, correct in full
> version Canon-G5.crw
> d) Wrong in thumbnail, wrong in preview, wrong in full version
> DSCF0019.raf
> S9500-vert.raf
> S9600-vert.raf
>
> For case d) there is apparently no information about orientation. Or is
> this a feature of .RAF files?
> For case c), there is, but why is it 180° wrong? Seems to be .crw specific.
> Case b), I dont know.
> Case a) is fortunately the largest group.

I have now updatetd to the latest libexiv2, libkexiv2, libkdcraw.
The results are still the same, especially with the .MRW files.
Screenshots at
http://digikam3rdparty.free.fr/Screenshots/thumbsandpreview_forgilles.png
http://digikam3rdparty.free.fr/Screenshots/ineditor_forgilles.png

On Gilles machine, the thumbs and preview are wrong, the image editor result
is correct. Can anyone confirm the one or the other result?
In the next days I will do some more investigations on this.

Marcel
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

Re: Rotation issue in image view

Marcel Wiesweg
In reply to this post by Marcel Wiesweg

Some more information:

> a) Correct in thumbnail, correct in preview, correct in full version
> 6057_009.cr2
> DSC0028.arw
> DSC_2162.nef
> L1000877.DNG
> k10d.dng

The MRW files have three sources of information:
TIFF tag ORIENTATION: This is where dcraw gets its information from
Exif Rotation: Seems to be set according to tiff tag
Minolta Makernote Cs5D Rotation: Used libkexiv2, used by digikam for preview
and thumbnail

> MINOLTA-DYNAX5D-01.MRW
This image has all three values set correctly

> b) Correct in thumbnail, correct in preview, _wrong_ in full version
> MINOLTA-DYNAX5D-03.MRW
> MINOLTA-DYNAX5D-04.MRW
These have only the makernote set.


The CRW files have two different sources:
The CRW header
The Exif tag

> c) Wrong (180°) in thumbnail, wrong (180°) in preview, correct in full
> version Canon-G5.crw
Dcraw gets the (correct) information from the CRW header.
The preview and thumbnail loader get the information from the Exif tag, which
is "right, top" and wrong by 180°.

> d) Wrong in thumbnail, wrong in preview, wrong in full version
> DSCF0019.raf
> S9500-vert.raf
> S9600-vert.raf
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

Re: Rotation issue in image view

Bugzilla from ahuggel@gmx.net
On Tuesday 13 March 2007 05:22, Marcel Wiesweg wrote:

>
> The CRW files have two different sources:
> The CRW header
> The Exif tag
>
> > c) Wrong (180°) in thumbnail, wrong (180°) in preview, correct in
> > full version Canon-G5.crw
>
> Dcraw gets the (correct) information from the CRW header.
> The preview and thumbnail loader get the information from the Exif
> tag, which is "right, top" and wrong by 180°.
>

I've changed the mapping from the CRW header information to Exif
orientation in Exiv2. The thumbnail and preview should now be correct
too.

-ahu.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

Re: Rotation issue in image view

Gilles Caulier-4
Ok,

Andreas, Marcel, look these demonstration done with my Dynax 5D :

1th test :
-----------

I just have taken one RAW picture at home with my camera, using a vertical orientation.

I look woth my camera preview witch orientation is used : the image is not vertically oriented, but horizontally...
Note than my camera have a setting to render on flat camera screen the image with the right orientation. This setting is volontary disable.

Now, i download the picture using konqueror : there is a RAW file and a THM file :

http://digikam3rdparty.free.fr/TEST_IMAGES/TestRotation/pict0437_before_paddle_rotation.mrw
http://digikam3rdparty.free.fr/TEST_IMAGES/TestRotation/pict0437_before_paddle_rotation.thm

With these both image, i create an Exif dump using Exiv2 :

http://digikam3rdparty.free.fr/TEST_IMAGES/TestRotation/pict0437_before_paddle_rotation.mrw.dump
http://digikam3rdparty.free.fr/TEST_IMAGES/TestRotation/pict0437_before_paddle_rotation.thm.dump

Now, I turn off the camera, remove the memory card, remove the power battery, to be sure than no info is recorded in camera hardware.

Now i put again the memory card and turn on my camera. I back to the camera preview mode and i rotate manaully the picture using the camera _paddle_. I reconnect the camera to the computer an redownload again the same files :

http://digikam3rdparty.free.fr/TEST_IMAGES/TestRotation/pict0437_after_paddle_rotation.mrw
http://digikam3rdparty.free.fr/TEST_IMAGES/TestRotation/pict0437_after_paddle_rotation.thm

With these both image, i create an Exif dump using Exiv2 :

http://digikam3rdparty.free.fr/TEST_IMAGES/TestRotation/pict0437_after_paddle_rotation.mrw.dump
http://digikam3rdparty.free.fr/TEST_IMAGES/TestRotation/pict0437_after_paddle_rotation.thm.dump

And finally, i do a simple diff between dump file. There are the result below :

diff pict0437_before_paddle_rotation.thm.dump pict0437_after_paddle_rotation.thm.dump
4c4
< Exif.Image.Orientation                       Short       1  top, left
---
> Exif.Image.Orientation                       Short       1  left, bottom


diff pict0437_before_paddle_rotation.mrw.dump pict0437_after_paddle_rotation.mrw.dump
7c7
< Exif.Image.Orientation                       Short       1  top, left
---
> Exif.Image.Orientation                       Short       1  left, bottom

Conclusion 1 : my camera set the Exif.Image.Orientation tags accordinly with my orientation correction set by the camera paddle.

2nd test :
-----------

And now the better for the end : use "kcraw -e file.mrw" to extract the JPG preview image as well, like digiKam do. Note than kcraw bin program is dcraw 8.60 generated by the libkdcraw library. The preview files are here :

http://digikam3rdparty.free.fr/TEST_IMAGES/TestRotation/pict0437_before_paddle_rotation.thumb.jpg
http://digikam3rdparty.free.fr/TEST_IMAGES/TestRotation/pict0437_after_paddle_rotation.thumb.jpg

==> The files are different because dcraw 8.60 include the Exif information with the preview image extracted. And of course, the difference are about Exif.Image.Orientation tag...

Conclusion 2 : well, just look the thumbnails aurientation in digiKam with these pictures (MRW, THM, and THUMB.JPG), and look the result :
 the file "pict0437_after_paddle_rotation.thumb.jpg" is wrong oriented...

Gilles




2007/3/13, Andreas Huggel <[hidden email]>:
On Tuesday 13 March 2007 05:22, Marcel Wiesweg wrote:

>
> The CRW files have two different sources:
> The CRW header
> The Exif tag
>
> > c) Wrong (180°) in thumbnail, wrong (180°) in preview, correct in
> > full version Canon-G5.crw
>
> Dcraw gets the (correct) information from the CRW header.
> The preview and thumbnail loader get the information from the Exif
> tag, which is "right, top" and wrong by 180°.
>

I've changed the mapping from the CRW header information to Exif
orientation in Exiv2. The thumbnail and preview should now be correct
too.

-ahu.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel


_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel