mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-01 00:46:20 -05:00
Respect image orientation and transforms in attachment widget
Fixes #16139
This commit is contained in:
parent
8ef90807f2
commit
574a6549f8
@ -22,6 +22,7 @@
|
||||
#include <QGridLayout>
|
||||
#include <QVariant>
|
||||
#include <QSettings>
|
||||
#include <QImageReader>
|
||||
#ifdef WITH_QTWEBKIT
|
||||
#include <QWebView>
|
||||
#endif
|
||||
@ -235,7 +236,10 @@ void QgsExternalResourceWidget::loadDocument( const QString &path )
|
||||
|
||||
if ( mDocumentViewerContent == Image )
|
||||
{
|
||||
QPixmap pm( resolvedPath );
|
||||
// use an image reader to ensure image orientation and transforms are correctly handled
|
||||
QImageReader ir( resolvedPath );
|
||||
ir.setAutoTransform( true );
|
||||
QPixmap pm = QPixmap::fromImage( ir.read() );
|
||||
mPixmapLabel->setPixmap( pm );
|
||||
updateDocumentViewer();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user