diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2026-07-11 13:40:57 -0230 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2026-07-11 13:41:24 -0230 |
| commit | ea59e2e451b3133ae2b7bafc2d57fdfbe378ee1d (patch) | |
| tree | a7e1318c14e3f6de42d1dff6e4de85ba23117619 | |
| parent | 65efc498293def259f57e64223f7e64eb1e1536d (diff) | |
| download | htmlimg-master.zip | |
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | cmd/htmlimg/main.go | 26 |
2 files changed, 27 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f9e961c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/htmlimg diff --git a/cmd/htmlimg/main.go b/cmd/htmlimg/main.go new file mode 100644 index 0000000..505b8a6 --- /dev/null +++ b/cmd/htmlimg/main.go @@ -0,0 +1,26 @@ +package main + +import ( + "fmt" + "image" + _ "image/jpeg" + _ "image/png" + "log" + "os" + + "git.samanthony.xyz/htmlimg" +) + +var lg = log.New(os.Stderr, "", 0) + +func main() { + m, _, err := image.Decode(os.Stdin) + if err != nil { + lg.Fatal(err) + } + tag, err := htmlimg.Encode(m) + if err != nil { + lg.Fatal(err) + } + fmt.Print(tag) +} |