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

fix detection of small RGB images #75

Merged
merged 1 commit into from
Oct 27, 2024

Conversation

olaf-rogalsky
Copy link
Contributor

@olaf-rogalsky olaf-rogalsky commented Jan 7, 2024

Small RGB images are not shown with the Sixel backend, because RGB triples are misinterpreted as dimension of length 3.
See, for example

using ColorTypes, ImageInTerminal, Sixel
img = mapslices(rgb -> ColorTypes.RGB{Float64}(rgb[1], rgb[2], rgb[3]), rand(100, 100, 3), dims = 3)

The code in question is on lines 58, 59 in ImageInTerminal.jl

        any(size(img) .≤ 12) && return false
        all(size(img) .≤ 60) && return false

This PR changes this to

        any(size(img)[1:2] .≤ 12) && return false
        all(size(img)[1:2] .≤ 60) && return false

@t-bltg t-bltg merged commit b552d8e into JuliaImages:master Oct 27, 2024
6 checks passed
Copy link
Member

@t-bltg t-bltg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@olaf-rogalsky
Copy link
Contributor Author

Almost forgot that one. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants