Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for auto-rotation of Image Exif metadata #630

Merged
merged 1 commit into from
Feb 1, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/QtImageReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include <QtGui/QImage>
#include <QtGui/QPainter>
#include <QtGui/QIcon>
#include <QtGui/QImageReader>

#if USE_RESVG == 1
// If defined and found in CMake, utilize the libresvg for parsing
Expand Down Expand Up @@ -75,8 +76,12 @@ void QtImageReader::Open()

if (!loaded) {
// Attempt to open file using Qt's build in image processing capabilities
// AutoTransform enables exif data to be parsed and auto transform the image
// to the correct orientation
image = std::make_shared<QImage>();
loaded = image->load(path);
QImageReader imgReader( path );
imgReader.setAutoTransform( true );
loaded = imgReader.read(image.get());
}

if (!loaded) {
Expand Down