diff options
author | Andreas Kling <kling@serenityos.org> | 2022-02-14 17:39:56 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-02-14 18:39:20 +0100 |
commit | 5c7f11f1cdda1c7ac89ecf4c21371f5628ee158d (patch) | |
tree | 093d4464c5fd71333c42c789324387d23f03117c /Userland | |
parent | aa679643c103ac94fa3356ecdbba903793e1b7d1 (diff) | |
download | serenity-5c7f11f1cdda1c7ac89ecf4c21371f5628ee158d.zip |
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.
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibGfx/PNGLoader.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGfx/PNGLoader.cpp b/Userland/Libraries/LibGfx/PNGLoader.cpp index 4496c66805..8d723d4768 100644 --- a/Userland/Libraries/LibGfx/PNGLoader.cpp +++ b/Userland/Libraries/LibGfx/PNGLoader.cpp @@ -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; |