Problem: png crash
Reason: png header info indicate that color type is RGB width = 92, height = 92.
but real rowbytes is 92 x 4, it means the color type should be RGBA
Solution: Correct the pixelformat according to the real rowbytes
Change-Id: I90f2865b54c62da6fdb41f32abe3971e274b6e94
Signed-off-by: xinyan.mei <xinyan.mei@samsung.com>
if( rowBytes > stride )
{
stride = GetTextureDimension(rowBytes);
- bufferWidth = stride / bpp;
+
+ bpp = stride / bufferWidth;
+ switch(bpp)
+ {
+ case 3:
+ pixelFormat = Pixel::RGB888;
+ break;
+ case 4:
+ pixelFormat = Pixel::RGBA8888;
+ break;
+ default:
+ break;
+ }
+
}
// decode the whole image into bitmap buffer