mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-24 18:28:57 +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
Notes:
sideshowbarker
2024-07-17 02:14:39 +09:00
Author: https://github.com/nico
Commit: 2e2cae26c6
Pull-request: https://github.com/SerenityOS/serenity/pull/23489
Reviewed-by: https://github.com/LucasChollet ✅
Reviewed-by: https://github.com/trflynn89
12 changed files with 22 additions and 22 deletions
|
@ -98,7 +98,7 @@ protected:
|
|||
|
||||
class ImageDecoder : public RefCounted<ImageDecoder> {
|
||||
public:
|
||||
static RefPtr<ImageDecoder> try_create_for_raw_bytes(ReadonlyBytes, Optional<ByteString> mime_type = {});
|
||||
static ErrorOr<RefPtr<ImageDecoder>> try_create_for_raw_bytes(ReadonlyBytes, Optional<ByteString> mime_type = {});
|
||||
~ImageDecoder() = default;
|
||||
|
||||
IntSize size() const { return m_plugin->size(); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue