Corrected gif decoder for handling transparency in BGRA format.
authormamata pattanaik <mamata.p@samsung.com>
Mon, 18 Mar 2013 12:02:43 +0000 (17:32 +0530)
committermamata pattanaik <mamata.p@samsung.com>
Mon, 18 Mar 2013 12:02:43 +0000 (17:32 +0530)
Change-Id: Ib034e06051d29d1bce93ad85ef886ec7c361ef6e
Signed-off-by: mamata pattanaik <mamata.p@samsung.com>
src/FMedia_GifDecoder.cpp

index b8a37e7..4d105ba 100644 (file)
@@ -331,7 +331,7 @@ _GifDecoder::DecodeOneFrame(unsigned char* pDstBuffer, unsigned int length)
                                        {
                                                for (k = 0; k < width; k++)
                                                {
-                                                       pBuf[k] = (pLine[k] == __transColor) ? pBuf[k] : ((unsigned int*) pPalette)[pLine[k]];
+                                                       pBuf[k] = (pLine[k] == __transColor) ? BGRA8888(0, 0, 0, 0) : ((unsigned int*) pPalette)[pLine[k]];
                                                }
                                        }
                                        else
@@ -383,7 +383,7 @@ _GifDecoder::DecodeOneFrame(unsigned char* pDstBuffer, unsigned int length)
                                {
                                        for (k = 0; k < width; k++)
                                        {
-                                               pBuf[k] = (pLine[k] == __transColor) ? pBuf[k] : ((unsigned int*) pPalette)[pLine[k]];
+                                               pBuf[k] = (pLine[k] == __transColor) ? BGRA8888(0, 0, 0, 0) : ((unsigned int*) pPalette)[pLine[k]];
                                        }
                                }
                                else
@@ -485,7 +485,7 @@ _GifDecoder::DecodeN(int& outLength)
                        //ext[i++] = extension ? *extension : 0;
                        if (extCode == GRAPHICS_EXT_FUNC_CODE)
                        {
-                               if (pExt[1] == 0x05)
+                               if ((pExt[1] && 0x01) == true)
                                {
                                        __transparent = true;
                                }