ImageInTerminal.jl icon indicating copy to clipboard operation
ImageInTerminal.jl copied to clipboard

fix detection of small RGB images

Open olaf-rogalsky opened this issue 1 year ago • 0 comments

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

olaf-rogalsky avatar Jan 07 '24 21:01 olaf-rogalsky