gpui: Add support for animated images (#13809)
This PR adds support for animated images. The image requires a id for it to actually animate across frames. Currently it only has support for `GIF`, I tried adding decoding a animated `WebP` into frames but it seems to error. This issue in the image crate seems to document this https://github.com/image-rs/image/issues/2263. Not sure if this is the best way or the desired way for animated images to work in GPUI but I would really like support for animated images. Open to feedback. Example Video: https://github.com/zed-industries/zed/assets/76515905/011f790f-d070-499b-96c9-bbff141fb002 Closes https://github.com/zed-industries/zed/issues/9993 Release Notes: - N/A --------- Co-authored-by: Antonio Scandurra <me@as-cii.com> Co-authored-by: Nathan <nathan@zed.dev>
This commit is contained in:
parent
c0df1e1846
commit
4bd935b409
6 changed files with 212 additions and 51 deletions
|
@ -77,7 +77,7 @@ impl ImageView {
|
|||
let height = data.height();
|
||||
let width = data.width();
|
||||
|
||||
let gpui_image_data = ImageData::new(data);
|
||||
let gpui_image_data = ImageData::new(vec![image::Frame::new(data)]);
|
||||
|
||||
return Ok(ImageView {
|
||||
height,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue