diff --git a/okular/ui/pageview.cpp b/okular/ui/pageview.cpp index 72c6952e..8b596b0a 100644 --- a/okular/ui/pageview.cpp +++ b/okular/ui/pageview.cpp @@ -2505,12 +2505,14 @@ void PageView::mouseReleaseEvent( QMouseEvent * e ) else { KMimeType::Ptr mime = KMimeType::findByUrl( fileName ); - QString type; - if ( !mime || mime == KMimeType::defaultMimeTypePtr() ) - type = "PNG"; - else - type = mime->name().section( '/', -1 ).toUpper(); - copyPix.save( fileName, qPrintable( type ) ); + QString type = QString::fromLatin1("PNG"); + if ( mime && mime != KMimeType::defaultMimeTypePtr() ) { + const QString formatType = KImageIO::typeForMime(mime->name(), KImageIO::Writing); + if (!formatType.isEmpty()) { + type = formatType; + } + } + copyPix.save( fileName, type.toLatin1() ); d->messageWindow->display( i18n( "Image [%1x%2] saved to %3 file.", copyPix.width(), copyPix.height(), type ) ); } }