mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 20:29:18 +00:00
Userland: Remove remaining callers of synchronous ImageDecoder API
Most of these now just await the image decoding, equivalent (ish) to the old behavior. A more async-aware refactor should happen some time in the future.
This commit is contained in:
parent
651e78fedb
commit
1c3f11a5a6
Notes:
sideshowbarker
2024-07-16 21:39:23 +09:00
Author: https://github.com/ADKaster
Commit: 1c3f11a5a6
Pull-request: https://github.com/SerenityOS/serenity/pull/24028
Reviewed-by: https://github.com/LucasChollet
Reviewed-by: https://github.com/awesomekling
7 changed files with 21 additions and 41 deletions
|
@ -717,9 +717,9 @@ static ErrorOr<NonnullRefPtr<Gfx::Bitmap>> render_thumbnail(StringView path)
|
|||
}
|
||||
|
||||
auto mime_type = Core::guess_mime_type_based_on_filename(path);
|
||||
auto decoded_image = maybe_client->decode_image(file->bytes(), thumbnail_size, mime_type);
|
||||
if (!decoded_image.has_value())
|
||||
return Error::from_string_literal("Unable to decode the image.");
|
||||
|
||||
// FIXME: Refactor thumbnail rendering to be more async-aware. Possibly return this promise to the caller.
|
||||
auto decoded_image = TRY(maybe_client->decode_image(file->bytes(), {}, {}, thumbnail_size, mime_type)->await());
|
||||
|
||||
return decoded_image;
|
||||
}));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue