Bug 103282

Summary: no exif-rotation in slideshow
Product: [Applications] digikam Reporter: tudor <tudor>
Component: Plugin-Generic-PresentationAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: wishlist    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In: 0.1.0

Description tudor 2005-04-05 13:02:19 UTC
Version:            (using KDE KDE 3.3.2)
Installed from:    Gentoo Packages
OS:                Linux

There is no exif-rotation in the slideshow of kipi-plugins. I use Digikam 0.7.2. Thanks
Comment 1 Stephan Binner 2005-04-05 18:30:55 UTC
Was there ever?
Comment 2 Renchi Raju 2005-04-05 19:48:46 UTC
CVS commit by pahlibar: 



respect app set angle for rotating images in slideshow. need to come up with
an angle spec to allow flipping of images as well (allowed by exif standard)
BUGS: 103282


  M +18 -1     imlibiface.cpp   1.5
  M +1 -1      imlibiface.h   1.5
  M +15 -7     plugin_slideshow.cpp   1.26
  M +11 -6     slideshow.cpp   1.14
  M +7 -3      slideshow.h   1.9
  M +13 -4     slideshowgl.cpp   1.15
  M +4 -3      slideshowgl.h   1.9
Comment 3 Renchi Raju 2005-04-05 19:50:17 UTC
CVS commit by pahlibar: 



if user wants exif rotated image, he will get exif rotated image (in kipi as
well)
CCBUGS: 103282


  M +24 -1     kipiinterface.cpp   1.20


--- kdeextragear-3/digikam/digikam/kipiinterface.cpp  #1.19:1.20
@@ -52,4 +52,5 @@ extern "C"
 
 #include <libkexif/kexifutils.h>
+#include <libkexif/kexifdata.h>
 
 // Local includes.
@@ -211,5 +212,27 @@ void DigikamImageInfo::addAttributes( co
 int DigikamImageInfo::angle()
 {
-    // TODO ! This will a libKExif implementation call ?
+    AlbumSettings *settings = AlbumSettings::instance();
+    if (settings->getExifRotate())
+    {
+        KExifData exifData;
+        
+        if (exifData.readFromFile(_url.path()))
+        {
+            KExifData::ImageOrientation orientation = exifData.getImageOrientation();
+
+            switch (orientation) {
+            case KExifData::ROT_180:
+                return 180;
+            case KExifData::ROT_90:
+            case KExifData::ROT_90_HFLIP:
+            case KExifData::ROT_90_VFLIP:
+                return 90;
+            case KExifData::ROT_270:
+                return 270;
+            default:
+                return 0;
+            }
+        }
+    }
     
     return 0;