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:
parent
8d9cb538d6
commit
6cf8eeb7a4
Notes:
sideshowbarker
2024-07-16 23:42:24 +09:00
Author: https://github.com/MacDue
Commit: 6cf8eeb7a4
Pull-request: https://github.com/SerenityOS/serenity/pull/17636
Reviewed-by: https://github.com/nico ✅
22 changed files with 40 additions and 40 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue