There is a bug in digiKam 1.2 which only affects big-endian systems. It
was fixed in digiKam 1.3. But since the next stable Debian release is
likely to include digiKam 1.2 only, I suggest the fix be included in
the Debian package.

This is my original bug report:

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

The situation was clear in comment #34 (April 20, 2010):

"Anyway I now compiled digiKam 1.2 with pgfutils.cpp from SVN (and no
other modifications) and the thumbnail quality seems good again. I
tried this in Debian and Ubuntu. So I guess the big-endian problem is
properly fixed now."

This e-mail comes with a "diff" between the version of
"libs/threadimageio/pgfutils.cpp" from digikam 1.2 and the one I'm
using on my PPC computer (which really is pgfutils.cpp from digikam 1.3
minus the new comments in the header).

Please remember to CC me, if you reply to this message, since I'm not a
member of this list.

I'm looking forward to a great Debian 6.0!

Vlado

-- 

       Vlado Plaga                        __o
    http://vlado-do.de                 _o/\<,_
    update: 2010-07-03                 (U)/ (u)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--- digikam-1.2.0/libs/threadimageio/pgfutils.cpp	2010-03-29 00:18:32.000000000 +0200
+++ ../digikam-1.2.0/libs/threadimageio/pgfutils.cpp	2010-05-15 08:42:00.099403788 +0200
@@ -65,8 +65,13 @@
         }
 
         img = QImage(pgfImg.Width(), pgfImg.Height(), QImage::Format_ARGB32);
+#ifdef __BIG_ENDIAN__
+        int map[] = {3, 2, 1, 0};
+#else
+        int map[] = {0, 1, 2, 3};
+#endif
         pgfImg.Read();
-        pgfImg.GetBitmap(img.bytesPerLine(), (UINT8*)img.bits(), img.depth());
+        pgfImg.GetBitmap(img.bytesPerLine(), (UINT8*)img.bits(), img.depth(), map);
     }
     catch(IOException& e)
     {
@@ -93,7 +98,11 @@
         // No need Alpha to optimize space on DB.
         if (img.format() != QImage::Format_ARGB32)
             img.convertToFormat(QImage::Format_ARGB32);
-
+#ifdef __BIG_ENDIAN__
+        int map[] = {3, 2, 1, 0};
+#else
+        int map[] = {0, 1, 2, 3};
+#endif
         CPGFImage pgfImg;
 
         PGFHeader header;
@@ -105,7 +114,7 @@
         header.mode     = ImageModeRGBA;
         header.background.rgbtBlue = header.background.rgbtGreen = header.background.rgbtRed = 0;
         pgfImg.SetHeader(header);
-        pgfImg.ImportBitmap(img.bytesPerLine(), (UINT8*)img.bits(), img.depth());
+        pgfImg.ImportBitmap(img.bytesPerLine(), (UINT8*)img.bits(), img.depth(), map);
 
         // TODO : optimize memory allocation...
         CPGFMemoryStream stream(256000);
@@ -193,7 +202,11 @@
         if (i<0) i=0;
 
         pgf.Read(i);  // Read PGF image at reduced level i.
-        int map[] = { 0, 1, 2 };
+#ifdef __BIG_ENDIAN__
+        int map[] = {3, 2, 1, 0};
+#else
+        int map[] = {0, 1, 2, 3};
+#endif
         img = QImage(pgf.Width(i), pgf.Height(i), QImage::Format_RGB32);
 
 /*
_______________________________________________
pkg-kde-extras mailing list
pkg-kde-extras@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/pkg-kde-extras

Reply via email to