png_loader(static): Fix the colorspace of an image with an alpha channel

Set colorspace to ABGR when colortype of lodepng is LCT_RGBA.
Since an image without an alpha channel becomes an ARGB colorspace with LCT_RGB,
it is the same as the default colorspace.
This commit is contained in:
JunsuChoi 2023-02-10 10:50:16 +09:00 committed by Hermet Park
parent 507b11829c
commit 02613feac3

View file

@ -213,5 +213,7 @@ void PngLoader::run(unsigned tid)
lodepng_decode(&image, &width, &height, &state, data, size);
if (state.info_png.color.colortype == LCT_RGBA) colorSpace = SwCanvas::ABGR8888;
_premultiply((uint32_t*)(image), width, height);
}