From c52ee0458e550b1a9c1441d554f8bd489a27cfde Mon Sep 17 00:00:00 2001 From: Joogab Yun Date: Tue, 7 Nov 2017 15:05:45 +0900 Subject: [PATCH] [4.0] fixed bug about PNG_COLOR_TYPE_GRAY_ALPHA Change-Id: Idd0d87f3b71c131d5138647d143eef8ad4648a80 --- .../tizen/image-loaders/loader-png.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/platform-abstractions/tizen/image-loaders/loader-png.cpp b/platform-abstractions/tizen/image-loaders/loader-png.cpp index 09e8819..2b2309e 100755 --- a/platform-abstractions/tizen/image-loaders/loader-png.cpp +++ b/platform-abstractions/tizen/image-loaders/loader-png.cpp @@ -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 ) -- 2.7.4