Commit a1490026 authored by Martin Koller's avatar Martin Koller
Browse files

Respect EXIF rotation information on loading an image

BUG: 252003
FIXED-IN: 16.12
parent 132b516d
...@@ -22,7 +22,7 @@ find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS ...@@ -22,7 +22,7 @@ find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
) )
find_package(KF5 REQUIRED COMPONENTS find_package(KF5 REQUIRED COMPONENTS
KDELibs4Support KDELibs4Support KExiv2
) )
add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS) add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
...@@ -36,9 +36,9 @@ else(KF5Sane_FOUND) ...@@ -36,9 +36,9 @@ else(KF5Sane_FOUND)
add_definitions(-DHAVE_KSANE=0) add_definitions(-DHAVE_KSANE=0)
endif(KF5Sane_FOUND) endif(KF5Sane_FOUND)
include_directories( include_directories(
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
${KEXIV2_INCLUDE_DIR}
) )
# KDE Application Version, managed by release script # KDE Application Version, managed by release script
...@@ -323,6 +323,7 @@ add_executable(kolourpaint ${kolourpaint_SRCS}) ...@@ -323,6 +323,7 @@ add_executable(kolourpaint ${kolourpaint_SRCS})
target_link_libraries(kolourpaint target_link_libraries(kolourpaint
KF5::KDELibs4Support KF5::KDELibs4Support
KF5::KExiv2
${KSANE_LIBRARIES} ${KSANE_LIBRARIES}
kolourpaint_lgpl kolourpaint_lgpl
) )
......
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
#include "views/manager/kpViewManager.h" #include "views/manager/kpViewManager.h"
#include <math.h> #include <math.h>
#include <kexiv2/kexiv2.h>
#include <qcolor.h> #include <qcolor.h>
#include <qimage.h> #include <qimage.h>
...@@ -55,7 +56,7 @@ ...@@ -55,7 +56,7 @@
#include <kio/netaccess.h> #include <kio/netaccess.h>
#include <klocale.h> #include <klocale.h>
#include <kmessagebox.h> #include <kmessagebox.h>
#include <kmimetype.h> // TODO: isn't this in KIO? #include <kmimetype.h>
//--------------------------------------------------------------------- //---------------------------------------------------------------------
...@@ -161,6 +162,10 @@ QImage kpDocument::getPixmapFromFile(const QUrl &url, bool suppressDoesntExistDi ...@@ -161,6 +162,10 @@ QImage kpDocument::getPixmapFromFile(const QUrl &url, bool suppressDoesntExistDi
// on the extension, but findByContent() correctly detects // on the extension, but findByContent() correctly detects
// it as a PNG. // it as a PNG.
image = QImage (tempFile); image = QImage (tempFile);
KExiv2Iface::KExiv2 exif(tempFile);
exif.rotateExifQImage(image, exif.getImageOrientation());
KIO::NetAccess::removeTempFile (tempFile); KIO::NetAccess::removeTempFile (tempFile);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment