wez / wezterm

A GPU-accelerated cross-platform terminal emulator and multiplexer written by @wez and implemented in Rust
https://wezfurlong.org/wezterm/
Other
16.65k stars 745 forks source link

iterm2 inline image protocol: Incorrect rendering of frames for some animated WebP images #3260

Closed AnonymouX47 closed 1 year ago

AnonymouX47 commented 1 year ago

What Operating System(s) are you seeing this problem on?

Linux X11

Which Wayland compositor or X11 Window manager(s) are you using?

KWin

WezTerm version

20230315-113447-2bfb29f1

Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?

Yes, and I updated the version box above to show the version of the nightly that I tried

Describe the bug

This is an aftermath of https://github.com/wez/wezterm/commit/2bfb29f1bee5dacd060202dcff71df4497eebaf7 fixing https://github.com/wez/wezterm/issues/3250.

The frames of some animated WebP images are not rendered correctly.

Using wezterm imgcat <image-file>:

gif-test-2.webp: bad cell_animation.webp: bad bored_animation.webp: good
https://user-images.githubusercontent.com/61663146/225427080-b1ad4dbe-10ad-4176-b455-e918de4ac3a6.mp4 https://user-images.githubusercontent.com/61663146/225430954-c015fba4-66ba-4e11-adbc-6d4e6f7574d0.mp4 https://user-images.githubusercontent.com/61663146/225431046-0d7503be-f941-4e33-8b54-554e8bdb84c1.mp4

webp-images.zip

I also tested with a different tool that utilizes the native animation capabilities of the protocol, the results were the same. As far as I've tested, this issue only affects WebP animated images, all APNGs and GIFs I've tested worked fine.


I tested the same images with a different tool that animates the image by drawing frame-by-frame. The frame delay/duration might not be exactly as specified in the image metadata though (if actually specified), I tweaked it to something reasonable for each. This is what they looked like:

gif-test-2.webp cell_animation.webp bored_animation.webp
https://user-images.githubusercontent.com/61663146/225431708-a427213d-4b93-42f5-bec4-f9c2fad4d3f6.mp4 https://user-images.githubusercontent.com/61663146/225433062-3e603f19-6457-4079-8f72-53e92541fed9.mp4 https://user-images.githubusercontent.com/61663146/225433160-0c4ee438-1be8-467c-903a-292dbefcc8cc.mp4

To Reproduce

wezterm imgcat <image-file>

webp-images.zip

Configuration

no config

Expected Behavior

Frames should be rendered correctly for all animated WebP images.

Logs

No response

Anything else?

No response

wez commented 1 year ago

This should be resolved now in main.

It typically takes about an hour before commits are available as nightly builds for all platforms. Linux builds are the fastest to build and are often available within about 20 minutes. Windows and macOS builds take a bit longer.

Please take a few moments to try out the fix and let me know how that works out. You can find the nightly downloads for your system in the wezterm installation docs.

If you prefer to use packages provided by your distribution or package manager of choice and don't want to replace that with a nightly download, keep in mind that you can download portable packages (eg: a .dmg file on macOS, a .zip file on Windows and an .AppImage file on Linux) that can be run without permanently installing or replacing an existing package, and can then simply be deleted once you no longer need them.

If you are eager and can build from source then you may be able to try this out more quickly.

AnonymouX47 commented 1 year ago

Fixed in https://github.com/wez/wezterm/commit/4576f4682852ebebaa18d04db4bde96f23ce5287

Thanks.

github-actions[bot] commented 1 year ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.