mirror of
https://github.com/talgo-cloud/talgo-libwebp.git
synced 2026-03-07 21:48:16 -08:00
Update examples.
This commit is contained in:
parent
fff8a5bbce
commit
6608fdcc01
2 changed files with 10 additions and 10 deletions
13
README.md
13
README.md
|
|
@ -4,7 +4,11 @@ go-libwebp
|
||||||
[](https://travis-ci.org/harukasan/go-libwebp)
|
[](https://travis-ci.org/harukasan/go-libwebp)
|
||||||
[](https://godoc.org/github.com/harukasan/go-libwebp/webp)
|
[](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…
Add table
Add a link
Reference in a new issue