[Kde-imaging] [Bug 200558] Crash when saving scanned image to .tiff

Nicolas Lécureuil neoclust at mandriva.org
Sat Jul 18 00:35:32 CEST 2009


https://bugs.kde.org/show_bug.cgi?id=200558





--- Comment #6 from Nicolas Lécureuil <neoclust mandriva org>  2009-07-18 00:35:30 ---
My logic was wrong.

This patch fixes the issue. can i commit this ?

Index: acquireimages/scandialog.cpp
===================================================================
--- acquireimages/scandialog.cpp        (révision 998526)
+++ acquireimages/scandialog.cpp        (copie de travail)
@@ -288,15 +288,16 @@
     meta.setImageColorWorkSpace(KExiv2Iface::KExiv2::WORKSPACE_SRGB);

     KIPIPlugins::KPWriteImage wImageIface;
-    if (frmt != KSaneIface::KSaneWidget::FormatRGB_16_C)
+
+    if ( (frmt = KSaneIface::KSaneWidget::FormatRGB_16_C) || (frmt =
KSaneIface::KSaneWidget::FormatRGB_8_C) )
     {
-        QByteArray data((const char*)img.bits(), img.numBytes());
-        wImageIface.setImageData(data, img.width(), img.height(), false, true,
prof, meta);
+        // 8 and 16 bits color depth image.
+        wImageIface.setImageData(ksane_data, width, height, true, false, prof,
meta);
     }
     else
     {
-        // 16 bits color depth image.
-        wImageIface.setImageData(ksane_data, width, height, true, false, prof,
meta);
+        QByteArray data((const char*)img.bits(), img.numBytes());
+        wImageIface.setImageData(data, img.width(), img.height(), false, true,
prof, meta);
     }

     if (format == QString("JPEG"))

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Kde-imaging mailing list