Reply to topic

kslideshow doesn't rotate Canon CR2 raw files

falolaf
Registered Member
Posts
13
Karma
0
Hi,

I have two installations of openSUSE 12.2. One with stock KDE 4.8 and one with KDE 4.9 from KR49.

On both machines I have setup kslideshow to randomly show images from my collection. A lot of these images are Canon CR2 raw files in portrait mode.

Now the problem is that kslideshow presents these portrait images in landscape mode. That is, kslideshow doesn't obey to the exif rotation information.

JPEG images in portrait mode are shown correctly though.

digiKam shows the images rotated, so it's possible to do it.

If I remember correctly the same images were displayed rotated in e.g. openSUSE 12.1 and Fedora17.

Is there anything I can do to make kslideshow rotate the images?

/Anders
User avatar bcooksley
Administrator
Posts
18556
Karma
83
OS
Can you please clarify what "kslideshow" is? Is this the Slideshow screensaver, or is it a separate application?


System Settings and Device Actions KCM maintainer
Image
falolaf
Registered Member
Posts
13
Karma
0
bcooksley wrote:Can you please clarify what "kslideshow" is? Is this the Slideshow screensaver, or is it a separate application?


Yes, I mean the slideshow screensaver. Thought it was named kslideshow as the config file is named that. Sorry for that!

/Anders
User avatar bcooksley
Administrator
Posts
18556
Karma
83
OS
I have examined the source code of the slideshow screensaver. It seems to be able to use KExiv2 to automatically rotate images per their Exiv data. As the name implies, KExiv2 wraps the exiv2 library. For this all to work however, it does assume that the KExiv2 library was available with development headers at compile time for kdeartwork however, which possibly may not be the case.

To confirm it was compiled with KExiv2 support, please run and post the output of this command:
Code: Select all
ldd /usr/bin/kslideshow.kss | grep -i exiv


System Settings and Device Actions KCM maintainer
Image
falolaf
Registered Member
Posts
13
Karma
0
bcooksley wrote:I have examined the source code of the slideshow screensaver. It seems to be able to use KExiv2 to automatically rotate images per their Exiv data. As the name implies, KExiv2 wraps the exiv2 library. For this all to work however, it does assume that the KExiv2 library was available with development headers at compile time for kdeartwork however, which possibly may not be the case.

To confirm it was compiled with KExiv2 support, please run and post the output of this command:
Code: Select all
ldd /usr/bin/kslideshow.kss | grep -i exiv


ldd /usr/bin/kslideshow.kss | grep -i exiv
libkexiv2.so.11 => /usr/lib64/libkexiv2.so.11 (0x00007fa0de3c0000)
libexiv2.so.12 => /usr/lib64/libexiv2.so.12 (0x00007fa0d96f6000)
falolaf
Registered Member
Posts
13
Karma
0
This is the output from exiv2 for two different images. The first is in portrait mode and the second is in landscape mode.

exiv2 -pt IMG_710* | grep Orientation
IMG_7102.CR2 Exif.Image.Orientation Short 1 left, bottom
IMG_7103.CR2 Exif.Image.Orientation Short 1 top, left

So exiv2 reports the same integer value for them both but the "string" orientation differs.

What does this mean?

/Anders

ps: Thanks for your efforts so far!
User avatar bcooksley
Administrator
Posts
18556
Karma
83
OS
Unfortunately i'm not familiar with the EXIF specification - however if libkexiv is available to KSlideshow then it should work - as it works in Digikam - and both use that library. Only thing I can think of is that Digikam has other methods for determining the proper image orientation other than the EXIF data...

Are you able to compile code? The easiest way to debug this may be by altering the code to output crucial information...


System Settings and Device Actions KCM maintainer
Image
falolaf
Registered Member
Posts
13
Karma
0
bcooksley wrote:Unfortunately i'm not familiar with the EXIF specification - however if libkexiv is available to KSlideshow then it should work - as it works in Digikam - and both use that library. Only thing I can think of is that Digikam has other methods for determining the proper image orientation other than the EXIF data...

Are you able to compile code? The easiest way to debug this may be by altering the code to output crucial information...


I did some more tesdting with exiv2 and it seems to output the correct orientation.

I have built kscreensaver just to see if there were any differencies but I had the same behaviour.

Any suggesions on how I can alter the code to get some good information?

/Anders
User avatar bcooksley
Administrator
Posts
18556
Karma
83
OS
In a text editor open "kdeartwork/kscreensaver/kdesavers/slideshow.cpp" and head to line 902. It should show this:
Code: Select all
exiv.rotateExifQImage(mImage, exiv.getImageOrientation());

Alter it so it reads like the following:
Code: Select all
kWarning() << "Performing Exiv Rotation for QImage:";
kWarning() << exiv.rotateExifQImage(mImage, exiv.getImageOrientation());

This should cause it to output a warning message indicating if the rotation was successful or not.

Please note that you will either need to run it by hand - or install it system-wide and run kdeinit4 afterward.


System Settings and Device Actions KCM maintainer
Image
falolaf
Registered Member
Posts
13
Karma
0
bcooksley wrote:In a text editor open "kdeartwork/kscreensaver/kdesavers/slideshow.cpp" and head to line 902. It should show this:
Code: Select all
exiv.rotateExifQImage(mImage, exiv.getImageOrientation());

Alter it so it reads like the following:
Code: Select all
kWarning() << "Performing Exiv Rotation for QImage:";
kWarning() << exiv.rotateExifQImage(mImage, exiv.getImageOrientation());

This should cause it to output a warning message indicating if the rotation was successful or not.

Please note that you will either need to run it by hand - or install it system-wide and run kdeinit4 afterward.


Ok, I will give it a try. But how do I run it by hand?

/Anders
User avatar bcooksley
Administrator
Posts
18556
Karma
83
OS
You will need to compile and install the source code - which requries executing cmake, make and make install with the correct arguments. If you are not familiar with the process, it may be better to simply file a bug.


System Settings and Device Actions KCM maintainer
Image
falolaf
Registered Member
Posts
13
Karma
0
bcooksley wrote:You will need to compile and install the source code - which requries executing cmake, make and make install with the correct arguments. If you are not familiar with the process, it may be better to simply file a bug.


I have built and installed before. I thought it was possible to not install it systemwide and then run just the screensaver.

Haven't had time to build with kWarning additions yet though.

/Anders
User avatar bcooksley
Administrator
Posts
18556
Karma
83
OS
Yes, you can install locally, just install it to ~/.kde4 (or ~/.kde if your distribution uses that) and run "kbuildsycoca4 --noincremental" afterward.


System Settings and Device Actions KCM maintainer
Image
falolaf
Registered Member
Posts
13
Karma
0
bcooksley wrote:Yes, you can install locally, just install it to ~/.kde4 (or ~/.kde if your distribution uses that) and run "kbuildsycoca4 --noincremental" afterward.


Ok, I will try that. Or can I use any folder of my choice? How do I then start kslideshow from there?

/Anders
User avatar bcooksley
Administrator
Posts
18556
Karma
83
OS
You can use a folder of your choice, but then you need to set KDEDIRS, PATH, LD_LIBRARY_PATH and other environment variables - before KDE is started (which is easily done using a script in ~/.kde4/env/)


System Settings and Device Actions KCM maintainer
Image

 
Reply to topic

Bookmarks



Who is online

Registered users: alake, Baidu [Spider], Bing [Bot], boudewijn, eddiej, Essence of Orange, Exabot [Bot], garthecho, Google [Bot], google01103, GreatEmerald, Hans, jstaniek, ken300, koriun, mutlu, odysseus-art, parzt, rasyalarasati, Sogatori, tadassu, TheraHedwig, Tuukka, Yahoo [Bot]