You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
425 B
24 lines
425 B
// Package main is an example implementation of WebP decoder.
|
|
package main
|
|
|
|
import (
|
|
"github.com/tidbyt/go-libwebp/test/util"
|
|
"github.com/tidbyt/go-libwebp/webp"
|
|
)
|
|
|
|
func main() {
|
|
var err error
|
|
|
|
// Read binary data
|
|
data := util.ReadFile("cosmos.webp")
|
|
|
|
// Decode
|
|
options := &webp.DecoderOptions{}
|
|
img, err := webp.DecodeRGBA(data, options)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
util.WritePNG(img, "encoded_cosmos.png")
|
|
}
|