go-libwebp

Experimental translation from libwebp to Go source.
Log | Files | Refs | README | LICENSE

commit 868dfe7ba157101b308ba4ae90661acbb3486829
parent 09329a8ab82ad1a5948b0115d7d71218c2c6267c
Author: Jack Mordaunt <jackmordaunt.dev@gmail.com>
Date:   Sat, 29 Jan 2022 19:31:46 +0800

docs: add context

- update example
- explain why this package exists
- explain the use of x/image/webp
- todo about handling encoding errors

Signed-off-by: Jack Mordaunt <jackmordaunt.dev@gmail.com>

Diffstat:
MREADME.md | 13+++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/README.md b/README.md @@ -1,13 +1,18 @@ # go-libwebp This is a [`ccgo`-based](https://pkg.go.dev/modernc.org/ccgo/v3) translation from [libwebp](https://github.com/webmproject/libwebp/) -in the hope to bring webp codec into Go space. +in the hope to bring webp encoder into Go space. -`go run ./cmd ./cmd/megopher.png` +`go run ./cmd encode ./cmd/megopher.png` Can consume JPEG and PNG images. -Status: Experimental +Status: Experimental. The translated code appears to work but has not been rigously tested. + +## Rationale + +There exists a webp decoder for Go `golang.org/x/image/webp` that does not include an encoder. Using it is obtuse: if you need an encoder you need to hack together another dependency. +This package extends `golang.org/x/image/webp` with an encoder translated from the libwebp project, providing a single package webp codec. ## Contributors @@ -20,4 +25,4 @@ problems we encounted while compiling `libwebp`. ## Todo - [ ] high level tests for various image formats -- [ ] porcelain wrapper package to integrate with image.Decode +- [ ] C style error handling