[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    koffice/libs/flake
From:       Boudewijn Rempt <boud () valdyas ! org>
Date:       2010-11-11 12:58:31
Message-ID: 20101111125831.76B19AC8A1 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1195527 by rempt:

Use the image file suffix instead of 0

If we pass 0, Qt tries to determine the type of the image file by
checking the contents. For some image files, that breaks, notably eps.

 M  +6 -3      KoImageData.cpp  


--- trunk/koffice/libs/flake/KoImageData.cpp #1195526:1195527
@@ -138,16 +138,19 @@
         // load image
         if (d->temporaryFile) {
             d->temporaryFile->open();
-            if (d->errorCode == Success && !d->image.load(d->temporaryFile, 0))
+            if (d->errorCode == Success && !d->image.load(d->temporaryFile, d->suffix.toLatin1())) {
                 d->errorCode = OpenFailed;
+            }
             d->temporaryFile->close();
         } else {
-            if (d->errorCode == Success && !d->image.load(d->imageLocation.toLocalFile()))
+            if (d->errorCode == Success && !d->image.load(d->imageLocation.toLocalFile())) {
                 d->errorCode = OpenFailed;
         }
-        if (d->errorCode == Success)
+        }
+        if (d->errorCode == Success) {
             d->dataStoreState = KoImageDataPrivate::StateImageLoaded;
     }
+    }
     return d->image;
 }
 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic