Fix exif rotation in unencrypted rooms
This commit is contained in:
parent
5f4ab925da
commit
007ee38b04
@ -69,7 +69,7 @@ MxcImageProvider::download(const QString &id,
|
|||||||
QDir().mkpath(fileInfo.absolutePath());
|
QDir().mkpath(fileInfo.absolutePath());
|
||||||
|
|
||||||
if (fileInfo.exists()) {
|
if (fileInfo.exists()) {
|
||||||
QImage image(fileInfo.absoluteFilePath());
|
QImage image = utils::readImageFromFile(fileInfo.absoluteFilePath());
|
||||||
if (!image.isNull()) {
|
if (!image.isNull()) {
|
||||||
image = image.scaled(
|
image = image.scaled(
|
||||||
requestedSize, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
requestedSize, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||||
@ -143,7 +143,8 @@ MxcImageProvider::download(const QString &id,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
QImage image(fileInfo.absoluteFilePath());
|
QImage image =
|
||||||
|
utils::readImageFromFile(fileInfo.absoluteFilePath());
|
||||||
if (!image.isNull()) {
|
if (!image.isNull()) {
|
||||||
then(id,
|
then(id,
|
||||||
requestedSize,
|
requestedSize,
|
||||||
@ -190,7 +191,8 @@ MxcImageProvider::download(const QString &id,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QImage image(fileInfo.absoluteFilePath());
|
QImage image =
|
||||||
|
utils::readImageFromFile(fileInfo.absoluteFilePath());
|
||||||
image.setText("original filename",
|
image.setText("original filename",
|
||||||
QString::fromStdString(originalFilename));
|
QString::fromStdString(originalFilename));
|
||||||
image.setText("mxc url", "mxc://" + id);
|
image.setText("mxc url", "mxc://" + id);
|
||||||
|
@ -802,6 +802,13 @@ utils::restoreCombobox(QComboBox *combo, const QString &value)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QImage
|
||||||
|
utils::readImageFromFile(const QString &filename)
|
||||||
|
{
|
||||||
|
QImageReader reader(filename);
|
||||||
|
reader.setAutoTransform(true);
|
||||||
|
return reader.read();
|
||||||
|
}
|
||||||
QImage
|
QImage
|
||||||
utils::readImage(const QByteArray &data)
|
utils::readImage(const QByteArray &data)
|
||||||
{
|
{
|
||||||
|
@ -310,6 +310,10 @@ centerWidget(QWidget *widget, QWidget *parent);
|
|||||||
void
|
void
|
||||||
restoreCombobox(QComboBox *combo, const QString &value);
|
restoreCombobox(QComboBox *combo, const QString &value);
|
||||||
|
|
||||||
|
//! Read image respecting exif orientation
|
||||||
|
QImage
|
||||||
|
readImageFromFile(const QString &filename);
|
||||||
|
|
||||||
//! Read image respecting exif orientation
|
//! Read image respecting exif orientation
|
||||||
QImage
|
QImage
|
||||||
readImage(const QByteArray &data);
|
readImage(const QByteArray &data);
|
||||||
|
Loading…
Reference in New Issue
Block a user