[Digikam-devel] [Bug 215743] New: Endianness bug loading 16 bits raw images

pochini at shiny.it pochini at shiny.it
Sun Nov 22 20:46:21 GMT 2009


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

           Summary: Endianness bug loading 16 bits raw images
           Product: digikam
           Version: 1.0.0-beta6
          Platform: Compiled Sources
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
        AssignedTo: digikam-devel at kde.org
        ReportedBy: pochini at shiny.it


Version:           1.0.0-beta6 (using KDE 4.3.3)
Compiler:          gcc (GCC) 4.1.2 (Gentoo 4.1.2 p1.0.2)  powerpc
OS:                Linux
Installed from:    Compiled From Sources

On big-endian systems digikam does not load 16 bits raw files correctly. The
following simple patch fixes the bug (it breaks little-endian archs), but I'm
not sure if the bug is here or if libkdcraw needs a fix instead.


--- digikam-1.0.0-beta6/libs/dimg/loaders/rawloader.cpp__orig   2009-11-22
19:49:05.000000000 +0100
+++ digikam-1.0.0-beta6/libs/dimg/loaders/rawloader.cpp 2009-11-22
21:37:29.000000000 +0100
@@ -182,9 +182,9 @@ bool RAWLoader::loadedFromDcraw(QByteArr
                 dst[1] = (unsigned short)((src[2]*256 + src[3]) * fac);     
// Green
                 dst[2] = (unsigned short)((src[0]*256 + src[1]) * fac);     
// Red
 #else
-                dst[0] = (unsigned short)((src[5]*256 + src[4]) * fac);     
// Blue
-                dst[1] = (unsigned short)((src[3]*256 + src[2]) * fac);     
// Green
-                dst[2] = (unsigned short)((src[1]*256 + src[0]) * fac);     
// Red
+                dst[0] = (unsigned short)((src[4]*256 + src[5]) * fac);     
// Blue
+                dst[1] = (unsigned short)((src[2]*256 + src[3]) * fac);     
// Green
+                dst[2] = (unsigned short)((src[0]*256 + src[1]) * fac);     
// Blue
 #endif
                 dst[3] = 0xFFFF;

-- 
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 Digikam-devel mailing list