[4.0] fixed bug about PNG_COLOR_TYPE_GRAY_ALPHA 15/159315/1 accepted/tizen/4.0/unified/20171109.065834 submit/tizen_4.0/20171108.072916
authorJoogab Yun <joogab.yun@samsung.com>
Tue, 7 Nov 2017 06:05:45 +0000 (15:05 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Wed, 8 Nov 2017 07:06:51 +0000 (16:06 +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 )