Пример #1
0
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")
}
Пример #2
0
func TestReadWritePNG(t *testing.T) {
	for _, file := range PNGFiles {
		png := util.ReadPNG(file)
		util.WritePNG(png, "util_test_"+file)
	}
}