Update examples.

master
Shunsuke Michii 10 years ago
parent fff8a5bbce
commit 6608fdcc01

@ -4,7 +4,11 @@ go-libwebp
[![Build Status](https://travis-ci.org/harukasan/go-libwebp.svg)](https://travis-ci.org/harukasan/go-libwebp) [![Build Status](https://travis-ci.org/harukasan/go-libwebp.svg)](https://travis-ci.org/harukasan/go-libwebp)
[![GoDoc](https://godoc.org/github.com/harukasan/go-libwebp/webp?status.svg)](https://godoc.org/github.com/harukasan/go-libwebp/webp) [![GoDoc](https://godoc.org/github.com/harukasan/go-libwebp/webp?status.svg)](https://godoc.org/github.com/harukasan/go-libwebp/webp)
A implementation of Go binding for [libwebp](https://developers.google.com/speed/webp/docs/api) written with cgo. A implementation of Go binding for [libwebp](https://developers.google.com/speed/webp/docs/api).
## Dependencies
- libwebp 0.4, 0.5
## Usage ## Usage
@ -63,10 +67,7 @@ func main() {
io.Close() io.Close()
}() }()
config := webp.Config{ config := webp.ConfigPreset(webp.PresetDefault, 90)
Preset: webp.PresetDefault,
Quality: 90,
}
// Encode into WebP // Encode into WebP
if err := webp.EncodeRGBA(w, img.(*image.RGBA), config); err != nil { if err := webp.EncodeRGBA(w, img.(*image.RGBA), config); err != nil {
@ -82,7 +83,7 @@ func main() {
## License ## License
Copyright (c) 2014 MICHII Shunsuke. All rights reserved. Copyright (c) 2016 MICHII Shunsuke. All rights reserved.
This library is released under The BSD 2-Clause License. This library is released under The BSD 2-Clause License.
See [LICENSE](./LICENSE). See [LICENSE](./LICENSE).

@ -20,10 +20,9 @@ func main() {
io.Close() io.Close()
}() }()
config := webp.Config{ config, err := webp.ConfigPreset(webp.PresetDefault, 90)
Preset: webp.PresetDefault, if err != nil {
Quality: 90, panic(err)
Method: 6,
} }
// Encode into WebP // Encode into WebP

Loading…
Cancel
Save