Skip to content

Commit 05af5ad

Browse files
committed
support ImageInTerminal 0.5
1 parent 852eba7 commit 05af5ad

File tree

5 files changed

+34
-28
lines changed

5 files changed

+34
-28
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Distances = "0.7, 0.8, 0.9, 0.10"
2525
FileIO = "1"
2626
GR = "= 0.50.1"
2727
ImageCore = "0.8.1, 0.9"
28-
ImageInTerminal = "0.3, 0.4, 0.5"
28+
ImageInTerminal = "0.5"
2929
ImageMagick = "0.7, 1"
3030
ImageTransformations = "0.8"
3131
LazyModules = "0.3"

src/fileio.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,12 @@ function _convert(
5656
size = (20,40), kw...)
5757

5858
# encode image into string
59-
strs = @withcolor ImageInTerminal.encodeimg(
60-
ImageInTerminal.SmallBlocks(),
61-
ImageInTerminal.TermColor256(),
59+
strs = @withcolor ImageInTerminal.ascii_show(
6260
img,
63-
size...)[1]
61+
ImageInTerminal.TermColor8bit(),
62+
:small,
63+
size
64+
)
6465
return join(strs,'\n')
6566
end
6667

src/render.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ function render_item(::BeforeAfterLimited, item)
1515
println()
1616
end
1717
function render_item(::BeforeAfterImage, item)
18-
str_item = @withcolor ImageInTerminal.encodeimg(ImageInTerminal.SmallBlocks(), ImageInTerminal.TermColor256(), item, 20, 40)[1]
18+
str_item = @withcolor ImageInTerminal.ascii_show(
19+
item,
20+
ImageInTerminal.TermColor8bit(),
21+
:small,
22+
(20, 40)
23+
)
1924
println("eltype: ", eltype(item))
2025
println("size: ", map(length, axes(item)))
2126
println("thumbnail:")

test/references/camera.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
▀▀▀▀▀▀▀▀▀
2-
▀▀▀▀▀▀▀▀▀
3-
▀▀▀▀▀▀▀▀▀
4-
▀▀▀▀▀▀▀▀▀
5-
▀▀▀▀▀▀▀▀▀
1+
▀▀▀▀▀▀▀▀▀
2+
▀▀▀▀▀▀▀▀▀
3+
▀▀▀▀▀▀▀▀▀
4+
▀▀▀▀▀▀▀▀▀
5+
▀▀▀▀▀▀▀▀▀

0 commit comments

Comments
 (0)