mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:27:35 +00:00
LibWeb: Log failures to decode image resources inside ImageResource
This commit is contained in:
parent
07fb0882bf
commit
55c5c97ab5
1 changed files with 12 additions and 10 deletions
|
@ -48,8 +48,13 @@ void ImageResource::decode_if_needed() const
|
|||
return;
|
||||
|
||||
auto image = Platform::ImageCodecPlugin::the().decode_image(encoded_data());
|
||||
m_has_attempted_decode = true;
|
||||
|
||||
if (!image.has_value()) {
|
||||
dbgln("Could not decode image resource {}", url());
|
||||
return;
|
||||
}
|
||||
|
||||
if (image.has_value()) {
|
||||
m_loop_count = image.value().loop_count;
|
||||
m_animated = image.value().is_animated;
|
||||
m_decoded_frames.resize(image.value().frames.size());
|
||||
|
@ -58,9 +63,6 @@ void ImageResource::decode_if_needed() const
|
|||
frame.bitmap = image.value().frames[i].bitmap;
|
||||
frame.duration = image.value().frames[i].duration;
|
||||
}
|
||||
}
|
||||
|
||||
m_has_attempted_decode = true;
|
||||
}
|
||||
|
||||
Gfx::Bitmap const* ImageResource::bitmap(size_t frame_index) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue