ImageInTerminal.jl
ImageInTerminal.jl copied to clipboard
fix detection of small RGB images
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