Respect exif rotation of images

Sometimes thumbnails still have the wrong dimensions, as they are scaled
to fit inside a rectange of the reported size in the image. Not sure,
who is wrong there, the media repo or we.
This commit is contained in:
Nicolas Werner 2020-04-26 11:26:51 +02:00
parent d94ac86816
commit 28adc9dc9b
4 changed files with 38 additions and 13 deletions

View file

@ -1,9 +1,11 @@
#include "Utils.h"
#include <QApplication>
#include <QBuffer>
#include <QComboBox>
#include <QDesktopWidget>
#include <QGuiApplication>
#include <QImageReader>
#include <QProcessEnvironment>
#include <QScreen>
#include <QSettings>
@ -657,3 +659,12 @@ utils::restoreCombobox(QComboBox *combo, const QString &value)
}
}
}
QImage
utils::readImage(QByteArray *data)
{
QBuffer buf(data);
QImageReader reader(&buf);
reader.setAutoTransform(true);
return reader.read();
}