aboutsummaryrefslogtreecommitdiff
path: root/src/image/decode_example_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/image/decode_example_test.go')
-rw-r--r--src/image/decode_example_test.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/image/decode_example_test.go b/src/image/decode_example_test.go
index 81fa0378e1..526c03f3c1 100644
--- a/src/image/decode_example_test.go
+++ b/src/image/decode_example_test.go
@@ -21,6 +21,15 @@ import (
_ "image/jpeg"
)
+func Example_decodeConfig() {
+ reader := base64.NewDecoder(base64.StdEncoding, strings.NewReader(data))
+ config, format, err := image.DecodeConfig(reader)
+ if err != nil {
+ log.Fatal(err)
+ }
+ fmt.Println("Width:", config.Width, "Height:", config.Height, "Format:", format)
+}
+
func Example() {
// Decode the JPEG data. If reading from file, create a reader with
//