mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-09 14:13:43 +00:00
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:
parent
507b11829c
commit
02613feac3
1 changed files with 2 additions and 0 deletions
|
@ -213,5 +213,7 @@ void PngLoader::run(unsigned tid)
|
||||||
|
|
||||||
lodepng_decode(&image, &width, &height, &state, data, size);
|
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);
|
_premultiply((uint32_t*)(image), width, height);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue