mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:58:12 +00:00
LibGfx: Make ImageDecoderPlugin::frame() return ErrorOr<>
This is a first step towards better error propagation from image codecs.
This commit is contained in:
parent
ae7656072a
commit
5a79c69b02
26 changed files with 101 additions and 100 deletions
|
@ -188,7 +188,11 @@ Icon FileIconProvider::icon_for_executable(const String& path)
|
|||
if (!section.has_value()) {
|
||||
bitmap = s_executable_icon.bitmap_for_size(icon_section.image_size);
|
||||
} else {
|
||||
bitmap = Gfx::PNGImageDecoderPlugin(reinterpret_cast<u8 const*>(section->raw_data()), section->size()).frame(0).image;
|
||||
// FIXME: Use the ImageDecoder service.
|
||||
auto frame_or_error = Gfx::PNGImageDecoderPlugin(reinterpret_cast<u8 const*>(section->raw_data()), section->size()).frame(0);
|
||||
if (!frame_or_error.is_error()) {
|
||||
bitmap = frame_or_error.value().image;
|
||||
}
|
||||
}
|
||||
|
||||
if (!bitmap) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue