mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-10 01:59:31 +00:00
LibGfx/PNG: Collect tRNS (transparency chunk) info for all color types
The tRNS metadata is valid for color types 0, 2 and 3, so let's collect it in each of those cases. This ensures that we produce a bitmap with an alpha channel if needed.
This commit is contained in:
parent
aa679643c1
commit
5c7f11f1cd
Notes:
sideshowbarker
2024-07-17 18:48:34 +09:00
Author: https://github.com/awesomekling
Commit: 5c7f11f1cd
1 changed files with 2 additions and 0 deletions
|
@ -834,6 +834,8 @@ static bool process_PLTE(ReadonlyBytes data, PNGLoadingContext& context)
|
|||
static bool process_tRNS(ReadonlyBytes data, PNGLoadingContext& context)
|
||||
{
|
||||
switch (context.color_type) {
|
||||
case 0:
|
||||
case 2:
|
||||
case 3:
|
||||
context.palette_transparency_data.append(data.data(), data.size());
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue