[Calligra] 0f7fe6d Fix: inserting jpg image that are bigger than 90k

Cyrille Berger <[email protected]> Wed, 22 Dec 2010 15:56:39 +0100 (CET)
Newsgroups gmane.comp.kde.devel.koffice
Message-ID <[email protected]>
commit 0f7fe6dd74c6c78b4e53e9b76c5a96155aeb9241
branch master
Author: Cyrille Berger <[email protected]>
Date:   Wed Dec 22 15:53:29 2010 +0100

    Fix: inserting jpg image that are bigger than 90k
    
    Details: when the image is too big, it is saved in a temporary files as-is (meaning raw jpeg data), but the "suffix" is set to "png", and then when loading from the temporary file we force-load as "png", the patch let Qt auto detect the image type
    
    This should probably be backport to koffice/2.3
    
    CCMAIL: [email protected]

diff --git a/libs/flake/KoImageData.cpp b/libs/flake/KoImageData.cpp
index 7759f8f..4e8f397 100644
--- a/libs/flake/KoImageData.cpp
+++ b/libs/flake/KoImageData.cpp
@@ -138,7 +138,7 @@ QImage KoImageData::image() const
         // load image
         if (d->temporaryFile) {
             d->temporaryFile->open();
-            if (d->errorCode == Success && !d->image.load(d->temporaryFile, d->suffix.toLatin1())) {
+            if (d->errorCode == Success && !d->image.load(d->temporaryFile->fileName())) {
                 d->errorCode = OpenFailed;
             }
             d->temporaryFile->close();