mirror of
https://bitbucket.org/smil3y/kde-extraapps.git
synced 2025-02-23 18:32:53 +00:00
kdeplasma: rotate image in-place from frame applet
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
54d2587bbe
commit
05a88e18de
3 changed files with 8 additions and 8 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue