From 6608fdcc01fa7c0c41a0d1d557b9e2aae568cbd3 Mon Sep 17 00:00:00 2001 From: Shunsuke Michii Date: Mon, 27 Jun 2016 14:48:49 +0900 Subject: [PATCH] Update examples. --- README.md | 13 +++++++------ examples/encode/encode.go | 7 +++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 4f81879..3b587a7 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,11 @@ 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) -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 @@ -63,10 +67,7 @@ func main() { io.Close() }() - config := webp.Config{ - Preset: webp.PresetDefault, - Quality: 90, - } + config := webp.ConfigPreset(webp.PresetDefault, 90) // Encode into WebP if err := webp.EncodeRGBA(w, img.(*image.RGBA), config); err != nil { @@ -82,7 +83,7 @@ func main() { ## 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. See [LICENSE](./LICENSE). diff --git a/examples/encode/encode.go b/examples/encode/encode.go index de6c484..f1eb977 100644 --- a/examples/encode/encode.go +++ b/examples/encode/encode.go @@ -20,10 +20,9 @@ func main() { io.Close() }() - config := webp.Config{ - Preset: webp.PresetDefault, - Quality: 90, - Method: 6, + config, err := webp.ConfigPreset(webp.PresetDefault, 90) + if err != nil { + panic(err) } // Encode into WebP