mirror of
https://github.com/RGBCube/serenity
synced 2025-07-07 08:17:36 +00:00
LibWeb: Use the sandboxed image ImageDecoder when loading favicons
This commit is contained in:
parent
25a8bd3a8a
commit
5bd3d0cf25
1 changed files with 5 additions and 8 deletions
|
@ -178,14 +178,11 @@ bool FrameLoader::load(LoadRequest& request, Type type)
|
||||||
if (data.is_empty())
|
if (data.is_empty())
|
||||||
return;
|
return;
|
||||||
RefPtr<Gfx::Bitmap> favicon_bitmap;
|
RefPtr<Gfx::Bitmap> favicon_bitmap;
|
||||||
auto decoder = Gfx::ImageDecoder::try_create(data);
|
auto decoded_image = image_decoder_client().decode_image(data);
|
||||||
if (!decoder) {
|
if (!decoded_image.has_value() || decoded_image->frames.is_empty()) {
|
||||||
dbgln("No image decoder plugin for favicon {}", favicon_url);
|
|
||||||
} else {
|
|
||||||
favicon_bitmap = decoder->frame(0).image;
|
|
||||||
if (!favicon_bitmap)
|
|
||||||
dbgln("Could not decode favicon {}", favicon_url);
|
dbgln("Could not decode favicon {}", favicon_url);
|
||||||
else
|
} else {
|
||||||
|
favicon_bitmap = decoded_image->frames[0].bitmap;
|
||||||
dbgln_if(IMAGE_DECODER_DEBUG, "Decoded favicon, {}", favicon_bitmap->size());
|
dbgln_if(IMAGE_DECODER_DEBUG, "Decoded favicon, {}", favicon_bitmap->size());
|
||||||
}
|
}
|
||||||
load_favicon(favicon_bitmap);
|
load_favicon(favicon_bitmap);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue