-
Notifications
You must be signed in to change notification settings - Fork 12
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
Fails with WSLtty #63
Comments
Same error with iterm2 |
Here's an MRE: using ImageInTerminal
using TestImages
image = testimage("cameraman.tif");
ImageInTerminal.imshow(image) with a more-tailored traceback: ERROR: LoadError: KeyError: key :nothing not found
Stacktrace:
[1] getindex(h::Dict{Symbol, Int64}, key::Symbol)
@ Base ./dict.jl:481
[2] _parse_color
@ ~/.julia/packages/Crayons/iBicM/src/crayon.jl:143 [inlined]
[3] #Crayon#1
@ ~/.julia/packages/Crayons/iBicM/src/crayon.jl:171 [inlined]
[4] encodeimg(::ImageInTerminal.SmallBlocks, colordepth::ImageInTerminal.TermColor256, img::Matrix{ColorTypes.Gray{FixedPointNumbers.N0f8}}, maxheight::Int64, maxwidth::Int64)
@ ImageInTerminal ~/.julia/packages/ImageInTerminal/CyZyh/src/encodeimg.jl:65
[5] imshow(io::Base.TTY, img::Matrix{ColorTypes.Gray{FixedPointNumbers.N0f8}}, colordepth::ImageInTerminal.TermColor256, maxsize::Tuple{Int64, Int64})
@ ImageInTerminal ~/.julia/packages/ImageInTerminal/CyZyh/src/imshow.jl:52
[6] imshow(io::Base.TTY, img::Matrix{ColorTypes.Gray{FixedPointNumbers.N0f8}}, colordepth::ImageInTerminal.TermColor256)
@ ImageInTerminal ~/.julia/packages/ImageInTerminal/CyZyh/src/imshow.jl:44
[7] imshow(::Matrix{ColorTypes.Gray{FixedPointNumbers.N0f8}})
@ ImageInTerminal ~/.julia/packages/ImageInTerminal/CyZyh/src/imshow.jl:82
[8] top-level scope
@ ~/hayesall/iit/debugging.jl:6 |
The toucan image does work: using ImageInTerminal, TestImages
image = testimage("toucan.png");
ImageInTerminal.imshow(image) |
It looks like a problem with the encoding. When images are smaller than the terminal width, things work fine: using ImageInTerminal, Images, TestImages
colors = colorview(RGB, rand(3, 10, 10)); # <--- Good ✅, (10 x 10)
toucan = testimage("toucan.png"); # <--- Good ✅, (150 x 162)
camera = testimage("cameraman.tif"); # <--- Broken ❌, (512 x 512)
coffee = testimage("coffee.png"); # <--- Broken ❌, (400 x 600) Which means that ImageInTerminal.jl/src/encodeimg.jl Lines 61 to 63 in 4cd5beb
|
Bug introduced by KristofferC/Crayons.jl#50. |
Thanks @hayesall for helping us track that down ! |
Sorry, I didn't mean to break the API like that. I think I thought that it was just an internal thing. |
No worries, those happen to us all 😃 |
The test problem fails under Win11 WSLtty terminal. Testing the package fails as well.
The text was updated successfully, but these errors were encountered: