Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imgcat shows black image instead of an image #5365

Closed
adelarsq opened this issue May 3, 2024 · 4 comments
Closed

imgcat shows black image instead of an image #5365

adelarsq opened this issue May 3, 2024 · 4 comments
Labels
bug Something isn't working fixed-in-nightly This is (or is assumed to be) fixed in the nightly builds.

Comments

@adelarsq
Copy link

adelarsq commented May 3, 2024

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

macOS

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

No response

WezTerm version

20240429-102818-0184e88e

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

For some reason imgcat shows a black image instead:

Captura de Tela 2024-05-02 às 21 18 24

This was the image used:

8cd747ff56496debdbe8c8d8e90ec61e

And this is the metadata:

$ file 8cd747ff56496debdbe8c8d8e90ec61e.jpg
8cd747ff56496debdbe8c8d8e90ec61e.jpg: JPEG image data, JFIF standard 1.01, aspect ratio, density 1x1, segment length 16, comment: "CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), quality = 100", baseline, precision 8, 1280x800, components 3

To Reproduce

Can be reproduced by using the provided image.

Configuration

no config

Expected Behavior

To show the image

Logs

Debug Overlay
wezterm version: 20240429-102818-0184e88e x86_64-apple-darwin
Window Environment: Mac OS X 10.15.7 (19H2026)
Lua Version: Lua 5.4
OpenGL: Intel HD Graphics 4000 OpenGL Engine 4.1 INTEL-14.7.28
Enter lua statements or expressions and hit Enter.
Press ESC or CTRL-D to exit
21:24:57.901 WARN wezterm_gui::glyphcache > image decoder thread terminated
21:24:57.901 ERROR wezterm_gui::glyphcache > Error decoding image: decode image: failed to fill whole buffer

Anything else?

No response

@adelarsq adelarsq added the bug Something isn't working label May 3, 2024
wez added a commit that referenced this issue May 5, 2024
This improves how non-conforming jpegs are decoded and displayed.

refs: #5365
@wez
Copy link
Owner

wez commented May 5, 2024

That error message comes from the upstream image and jpeg decoder crates.
I believe that the input image is subtly corrupt and the consequence is that it fails to decode at all because the jpeg decoder has no error recovery logic.
I've updated to a newer version of the image crate which now uses a different jpeg decoder, and this issue is now resolved for me.

@wez wez added the fixed-in-nightly This is (or is assumed to be) fixed in the nightly builds. label May 5, 2024
@wez
Copy link
Owner

wez commented May 5, 2024

The fix should be available in a nightly build within about an hour from now

@wez wez closed this as completed May 5, 2024
@adelarsq
Copy link
Author

adelarsq commented May 6, 2024

@wez Fix confirmed. Thanks a lot!

Copy link
Contributor

github-actions bot commented Jun 6, 2024

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working fixed-in-nightly This is (or is assumed to be) fixed in the nightly builds.
Projects
None yet
Development

No branches or pull requests

2 participants