kdeplasma: rotate image in-place from frame applet

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2021-06-26 21:57:31 +03:00
parent 54d2587bbe
commit 05a88e18de
3 changed files with 8 additions and 8 deletions

View file

@ -40,22 +40,20 @@ ImageLoader::ImageLoader(const QString &path)
#endif
}
QImage ImageLoader::correctRotation(const QImage& image, const QString &path)
void ImageLoader::correctRotation(QImage& image, const QString &path)
{
#ifdef HAVE_KEXIV2
if (!image.isNull()) {
QImage tempImage(image);
KExiv2Iface::KExiv2 exiv(path);
exiv.rotateExifQImage(tempImage, exiv.getImageOrientation());
return tempImage;
exiv.rotateExifQImage(image, exiv.getImageOrientation());
#endif
}
return image;
}
void ImageLoader::run()
{
QImage img = correctRotation(QImage(m_path), m_path);
QImage img(m_path);
correctRotation(img, m_path);
emit loaded(img);
}

View file

@ -32,7 +32,7 @@ class ImageLoader : public QObject, public QRunnable
public:
ImageLoader(const QString &path);
static QImage correctRotation(const QImage& tempImage, const QString &path);
static void correctRotation(QImage& tempImage, const QString &path);
void run();
Q_SIGNALS:

View file

@ -164,7 +164,9 @@ void Picture::slotFinished( KJob *job )
setPath(path);
}
emit checkImageLoaded(ImageLoader::correctRotation(image, path));
ImageLoader::correctRotation(image, path);
emit checkImageLoaded(image);
}
void Picture::checkImageLoaded(const QImage &newImage)