diff --git a/testdata/gopher-doc.with-alpha.lossless.webp b/testdata/gopher-doc.with-alpha.lossless.webp new file mode 100644 index 0000000..fe5018d Binary files /dev/null and b/testdata/gopher-doc.with-alpha.lossless.webp differ diff --git a/testdata/gopher-doc.with-alpha.png b/testdata/gopher-doc.with-alpha.png new file mode 100644 index 0000000..ba3236b Binary files /dev/null and b/testdata/gopher-doc.with-alpha.png differ diff --git a/webp/decode.go b/webp/decode.go index d6eefd5..5e3bfc4 100644 --- a/webp/decode.go +++ b/webp/decode.go @@ -102,9 +102,6 @@ func decode(r io.Reader, configOnly bool) (image.Image, image.Config, error) { return m, image.Config{}, nil case fccVP8L: - if wantAlpha || alpha != nil { - return nil, image.Config{}, errInvalidFormat - } if configOnly { c, err := vp8l.DecodeConfig(chunkData) return nil, c, err diff --git a/webp/decode_test.go b/webp/decode_test.go index ad65b10..165e085 100644 --- a/webp/decode_test.go +++ b/webp/decode_test.go @@ -179,6 +179,7 @@ func TestDecodeVP8L(t *testing.T) { "gopher-doc.8bpp", "tux", "yellow_rose", + "gopher-doc.with-alpha", } loop: