fixed bug about PNG_COLOR_TYPE_GRAY_ALPHA 26/159126/2
authorJoogab Yun <joogab.yun@samsung.com>
Tue, 7 Nov 2017 06:05:45 +0000 (15:05 +0900)
committerJoogab Yun <joogab.yun@samsung.com>
Tue, 7 Nov 2017 07:14:45 +0000 (16:14 +0900)
Change-Id: Idd0d87f3b71c131d5138647d143eef8ad4648a80

platform-abstractions/tizen/image-loaders/loader-png.cpp

index 09e8819..2b2309e 100755 (executable)
@@ -165,17 +165,20 @@ bool LoadBitmapFromPng( const ImageLoader::Input& input, Integration::Bitmap& bi
   if( colortype == PNG_COLOR_TYPE_GRAY ||
       colortype == PNG_COLOR_TYPE_GRAY_ALPHA )
   {
-    if( png_get_valid(png, info, PNG_INFO_tRNS) )
+    if( colortype == PNG_COLOR_TYPE_GRAY )
     {
-      colortype = PNG_COLOR_TYPE_GRAY_ALPHA;
-      /* expand transparency entry -> alpha channel if present */
-      png_set_tRNS_to_alpha(png);
-      pixelFormat = Pixel::LA88;
+      pixelFormat = Pixel::L8;
+      if( png_get_valid(png, info, PNG_INFO_tRNS) )
+      {
+        colortype = PNG_COLOR_TYPE_GRAY_ALPHA;
+        /* expand transparency entry -> alpha channel if present */
+        png_set_tRNS_to_alpha(png);
+        pixelFormat = Pixel::LA88;
+      }
     }
     else
     {
-      colortype = PNG_COLOR_TYPE_GRAY;
-      pixelFormat = Pixel::L8;
+      pixelFormat = Pixel::LA88;
     }
 
     if( colordepth < 8 )