Skip to content

Commit fa5d172

Browse files
committed
Add support for more image formats
1 parent efe4f13 commit fa5d172

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# icat
22

3-
Go version of image cat (or `imgcat`) with `webp` and URL support and fallback to ASCII art.
3+
Go version of image cat (or `imgcat`) with `webp`, `tiff` and (optional) `HEIF` image support (on top of standard Go images formats `gif`, `jpg`, `png`) and URL support and fallback to ASCII art.
44
`PrintImageFile` and `PrintImageURL` will print the image to the terminal, trying to figure out which terminal you are using and fallback to ASCII art if the terminal does not support images.
55

66
## Cmd line version
@@ -40,3 +40,8 @@ func main() {
4040
}
4141
}
4242
```
43+
44+
45+
## LICENSE
46+
47+
[MIT](LICENSE)

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ require (
1414
github.com/mattn/go-isatty v0.0.20 // indirect
1515
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 // indirect
1616
github.com/stretchr/testify v1.10.0 // indirect
17+
github.com/strukturag/libheif v1.19.5 // indirect
1718
github.com/wayneashleyberry/terminal-dimensions v1.1.0 // indirect
1819
golang.org/x/term v0.27.0 // indirect
1920
)

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
1616
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
1717
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
1818
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
19+
github.com/strukturag/libheif v1.19.5 h1:YLf0RO6mNQYeeNkFSk/Uto8EyUOCzDpLPjbEBoeV9Io=
20+
github.com/strukturag/libheif v1.19.5/go.mod h1:E/PNRlmVtrtj9j2AvBZlrO4dsBDu6KfwDZn7X1Ce8Ks=
1921
github.com/wayneashleyberry/terminal-dimensions v1.1.0 h1:EB7cIzBdsOzAgmhTUtTTQXBByuPheP/Zv1zL2BRPY6g=
2022
github.com/wayneashleyberry/terminal-dimensions v1.1.0/go.mod h1:2lc/0eWCObmhRczn2SdGSQtgBooLUzIotkkEGXqghyg=
2123
golang.org/x/image v0.23.0 h1:HseQ7c2OpPKTPVzNjG5fwJsOTCiiwS4QdsYi5XU6H68=

heif.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//go:build heif
2+
3+
// Set --tags=heif to build support for hief in to icat.
4+
// libheif is in LGPL-3.0 license, so it is not included in the default build.
5+
// This also requires the libheif library to be installed on the system and using CGO.
6+
7+
package icat
8+
9+
import (
10+
_ "github.com/strukturag/libheif/go/heif"
11+
)

0 commit comments

Comments
 (0)