[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: KSlideshow: EXIF orientation in images is not honored
From:       Guillaume Benny <guillaume.benny () sympatico ! ca>
Date:       2010-09-22 16:09:06
Message-ID: BLU0-SMTP9546169DA6AF93BDE463AB86600 () phx ! gbl
[Download RAW message or body]

On Wednesday September 22 2010 02:05:52 Anne-Marie Mahfouf wrote:
> On Wednesday 22 September 2010 02:56:41 Guillaume Benny wrote:
> > 
> >  https://bugs.kde.org/show_bug.cgi?id=231599
> > 
> 
> Hi Guillaume,
> 
> Thanks for your effort in tackling this bug!
> 
> You need to check if the user has installed KEXIV2 because if he has not,
> then #include <libkexiv2/kexiv2.h>
> will fail.
> 
> Can you make a proper patch? If not I'll do it when I have time. ( A patch
> is a diff against a KDE version that one can also apply in his code.)
> 
> Best regards,
> 
> Anne-Marie
> 

Hi,

 Thanks for your answer. I don't know how you wanted the patch and since I 
don't have a KDE developper's environnement, I did the best I could! :-)

 Two files are attached to this mail:

1) basic_patch: This patch is exacly what I proposed in the bug report but in 
patch format. The patch was taken from the directory where the files are.

2) complete_patch: This patch is like the first one but I've tried to test if 
Kexiv2 was installed. I've never worked with cmake and I did not test this 
patch but from what I could see on the internet, it should work.

 Thanks again,

 Guillaume

["basic_patch" (text/x-patch)]

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4f02d30..28a0f04 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -41,7 +41,7 @@ kde4_add_ui_files(kslideshow.kss_SRCS slideshowcfg.ui )
 
 kde4_add_executable(kslideshow.kss ${kslideshow.kss_SRCS})
 
-target_link_libraries(kslideshow.kss  ${KDE4_KIO_LIBS}  m  ${KDE4WORKSPACE_KSCREENSAVER_LIBRARY})
+target_link_libraries(kslideshow.kss  ${KDE4_KIO_LIBS}  m  ${KDE4WORKSPACE_KSCREENSAVER_LIBRARY} kexiv2)
 
 install(TARGETS kslideshow.kss  ${INSTALL_TARGETS_DEFAULT_ARGS} )
 
diff --git a/slideshow.cpp b/slideshow.cpp
index 65c70de..f223a8a 100644
--- a/slideshow.cpp
+++ b/slideshow.cpp
@@ -45,6 +45,8 @@
 #include <math.h>
 #include <time.h>
 
+#include <libkexiv2/kexiv2.h>
+
 #include "slideshow.h"
 #include "slideshow.moc"
 
@@ -877,6 +879,8 @@ nexttry:
     goto nexttry;
   }
   mFileIdx++;
+  KExiv2Iface::KExiv2 exiv(fname);
+  exiv.rotateExifQImage(mImage, exiv.getImageOrientation());
 
   mImageName = QFileInfo(fname).baseName();
 }

["complete_patch" (text/x-patch)]

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4f02d30..a510f15 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,6 +4,9 @@ configure_file (config-kdesavers.h.cmake \
${CMAKE_CURRENT_BINARY_DIR}/config-kdes  macro_optional_find_package(Eigen2)
 macro_log_feature(EIGEN2_FOUND "Eigen2" "A C++ template library for linear algebra" \
"kdesupport" FALSE "" "Needed to build the krotation and kpendulum screensavers" )  
+macro_optional_find_package(Kexiv2)
+macro_log_feature(KEXIV2_FOUND "Kexiv2" "A C++ library for exiv manipulation" \
"kdesupport" FALSE "" "Needed rotate photos with exif data" ) +
 option(KSCREENSAVER_SOUND_SUPPORT "Build with sound support" OFF)
 
 include_directories(${KDE4WORKSPACE_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR})
@@ -41,7 +44,11 @@ kde4_add_ui_files(kslideshow.kss_SRCS slideshowcfg.ui )
 
 kde4_add_executable(kslideshow.kss ${kslideshow.kss_SRCS})
 
-target_link_libraries(kslideshow.kss  ${KDE4_KIO_LIBS}  m  \
${KDE4WORKSPACE_KSCREENSAVER_LIBRARY}) +if(KEXIV2_FOUND)
+    target_link_libraries(kslideshow.kss  ${KDE4_KIO_LIBS}  m  \
${KDE4WORKSPACE_KSCREENSAVER_LIBRARY} kexiv2) +else(KEXIV2_FOUND)
+    target_link_libraries(kslideshow.kss  ${KDE4_KIO_LIBS}  m  \
${KDE4WORKSPACE_KSCREENSAVER_LIBRARY}) +endif(KEXIV2_FOUND)
 
 install(TARGETS kslideshow.kss  ${INSTALL_TARGETS_DEFAULT_ARGS} )
 
diff --git a/slideshow.cpp b/slideshow.cpp
index 65c70de..280cf14 100644
--- a/slideshow.cpp
+++ b/slideshow.cpp
@@ -45,6 +45,10 @@
 #include <math.h>
 #include <time.h>
 
+#if KEXIV2_FOUND
+#include <libkexiv2/kexiv2.h>
+#endif
+
 #include "slideshow.h"
 #include "slideshow.moc"
 
@@ -877,6 +881,10 @@ nexttry:
     goto nexttry;
   }
   mFileIdx++;
+#if KEXIV2_FOUND
+  KExiv2Iface::KExiv2 exiv(fname);
+  exiv.rotateExifQImage(mImage, exiv.getImageOrientation());
+#endif
 
   mImageName = QFileInfo(fname).baseName();
 }



>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic