1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-10 18:10:56 +09:00

LibGfx: Return bool not ErrorOr<bool> from ImageDecoderPlugin::sniff()

Nobody made use of the ErrorOr return value and it just added more
chance of confusion, since it was not clear if failing to sniff an
image should return an error or false. The answer was false, if you
returned Error you'd crash the ImageDecoder.
This commit is contained in:
MacDue 2023-02-26 18:02:50 +00:00 committed by Andreas Kling
parent 8d9cb538d6
commit 6cf8eeb7a4
Notes: sideshowbarker 2024-07-16 23:42:24 +09:00
22 changed files with 40 additions and 40 deletions

View file

@ -210,7 +210,7 @@ Icon FileIconProvider::icon_for_executable(DeprecatedString const& path)
bitmap = s_executable_icon.bitmap_for_size(icon_section.image_size);
} else {
// FIXME: Use the ImageDecoder service.
if (Gfx::PNGImageDecoderPlugin::sniff({ section->raw_data(), section->size() }).release_value_but_fixme_should_propagate_errors()) {
if (Gfx::PNGImageDecoderPlugin::sniff({ section->raw_data(), section->size() })) {
auto png_decoder = Gfx::PNGImageDecoderPlugin::create({ section->raw_data(), section->size() }).release_value_but_fixme_should_propagate_errors();
if (png_decoder->initialize()) {
auto frame_or_error = png_decoder->frame(0);