# Fix crash and enable GIF animation in markdown preview \(\#53459\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/0ddc7d06664f5cffc85fa1b62e6fa6eb694fa41c)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 0ddc7d06664f5cffc85fa1b62e6fa6eb694fa41c

Requested commit: 0ddc7d06664f5cffc85fa1b62e6fa6eb694fa41c

Commit: 0ddc7d06664f5cffc85fa1b62e6fa6eb694fa41c

Tree: e7f7761cf49cc357c2a86b9b5386314644eadaac

Author: David Alecrim

Committer: GitHub

## Message

```
Fix crash and enable GIF animation in markdown preview (#53459)

Closes #53426

Fixes a crash when previewing markdown with GIFs, and enables GIF
animation in the preview panel.

Two issues: a partially-decoded GIF could crash the preview, and GIFs in
markdown previews never animated.

The fix for GIFs with empty comment extensions (`21 fe 00`) was
implemented upstream in the `image-gif` crate (image-rs/image-gif#228)
and released as `gif 0.14.2`. This PR bumps the dependency so those GIFs
now render correctly in the markdown preview without any further changes
to Zed itself.

## Screenshot
Left=VS Code
Right=Zed


https://github.com/user-attachments/assets/7950abbc-1a79-4f01-a425-9595aa688325

Release Notes:

- Fixed a crash in certain scenarios when opening Markdown Preview with
GIFs.
- Added GIF animation support for Markdown Preview.

---------

Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
```

## Parents

- [920ead54b70e90e870fd72d8a5f2ceba16c11b63](https://git.cafe/gitcafe/zed/commit/920ead54b70e90e870fd72d8a5f2ceba16c11b63?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/0ddc7d06664f5cffc85fa1b62e6fa6eb694fa41c?format=markdown)
