mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:57:44 +00:00
LibGfx+Fallout: Make ImageDecoder return ErrorOr
...from try_create_for_raw_bytes(). If a plugin returns `true` from sniff but then fails when calling its `create()` method, we now no longer swallow that error. Allows `image` (and other places in the system) to print a more actionable error if early image headers are invalid. (We now no longer try to find another plugin that can also handle the image.) Fixes a regression from #20063 / #19893 -- before then, we didn't do fallible work this early.
This commit is contained in:
parent
be5e7a360f
commit
2e2cae26c6
12 changed files with 22 additions and 22 deletions
|
@ -79,7 +79,7 @@ void ImageWidget::load_from_file(StringView path)
|
|||
|
||||
auto& mapped_file = *file_or_error.value();
|
||||
auto mime_type = Core::guess_mime_type_based_on_filename(path);
|
||||
m_image_decoder = Gfx::ImageDecoder::try_create_for_raw_bytes(mapped_file.bytes(), mime_type);
|
||||
m_image_decoder = MUST(Gfx::ImageDecoder::try_create_for_raw_bytes(mapped_file.bytes(), mime_type));
|
||||
VERIFY(m_image_decoder);
|
||||
|
||||
auto frame = m_image_decoder->frame(0).release_value_but_fixme_should_propagate_errors();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue