Commit Graph

12 Commits

Author SHA1 Message Date
Aamir Khan
25eff15cb8 webp: fix panic in case of invalid chunkID
At the time of decoding webp file, if chunkID is not one of
{'ALPH', 'VP8', 'VP8L', 'VP8X'} return errInvalidFormat

Fixes golang/go#10384

Change-Id: I167909b5ddef174d161f806297a08fac6aabcf19
Reviewed-on: https://go-review.googlesource.com/9839
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2015-05-11 04:53:49 +00:00
David Symonds
0351284b2d image: add import comments.
Change-Id: I2d3a1d002ad43af24cd8b451a2cae4c217482675
Reviewed-on: https://go-review.googlesource.com/1237
Reviewed-by: Andrew Gerrand <adg@golang.org>
2014-12-09 22:43:18 +00:00
Andrew Gerrand
2e99ef522d go.image: use golang.org/x/... import paths
LGTM=bradfitz, rsc
R=rsc, bradfitz
CC=golang-codereviews
https://golang.org/cl/169090043
2014-11-10 08:52:14 +11:00
Nigel Tao
c087821dc6 go.image/webp: implement alpha filtering and uncompressed alpha.
This passes the four new alpha_*.webp conformance tests referred to in
https://golang.org/cl/162850043/#msg7

LGTM=pascal.massimino, r
R=r, pascal.massimino
CC=golang-codereviews
https://golang.org/cl/163630043
2014-10-31 17:06:42 +11:00
Nigel Tao
013424077b go.image/riff: new package.
Also update package webp to use package riff.

LGTM=r
R=r
CC=golang-codereviews, pascal.massimino
https://golang.org/cl/162850043
2014-10-23 08:59:14 +11:00
Nigel Tao
ef5e0288ce go.image/webp: implement lossy-with-alpha.
This fixes all three lossy_alpha*.webp conformance tests.

The test data was generated by cwebp/dwebp version 0.4.1:
cwebp yellow_rose.png -o yellow_rose.lossy-with-alpha.webp
dwebp yellow_rose.lossy-with-alpha.webp -pgm -o tmp.pgm
convert tmp.pgm yellow_rose.lossy-with-alpha.webp.nycbcra.png

LGTM=pascal.massimino, r
R=r, pascal.massimino
CC=golang-codereviews
https://golang.org/cl/154350043
2014-10-20 10:46:12 +11:00
Nigel Tao
d354b8dda9 go.image/webp/nycbcra: new package.
LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/147500043
2014-10-08 14:30:35 +11:00
Nigel Tao
07fcf9c2fe vp8: skip filtering for all-zero-DC macroblock residuals.
This makes the Go code match the libwebp C code's output on
blue-purple-pink-large.*-filter.lossy.webp

Also make the various WEBP benchmarks all decode a similar image,
the image at http://blog.golang.org/gophercon/image01.jpg, to make
it more meaningful to e.g. compare the simple filter's numbers with
the normal filter's numbers.

Also fix a "go vet" warning in webp/decode.go.

The test data was generated by:
wget http://blog.golang.org/gophercon/image01.jpg -O blue-purple-pink-large.jpeg
convert blue-purple-pink-large.jpeg blue-purple-pink-large.png
cwebp -lossless blue-purple-pink-large.png -o blue-purple-pink-large.lossless.webp
cwebp -q 80 -f 0 blue-purple-pink-large.png -o blue-purple-pink-large.no-filter.lossy.webp
cwebp -q 80 -strong blue-purple-pink-large.png -o blue-purple-pink-large.normal-filter.lossy.webp
cwebp -q 80 -nostrong blue-purple-pink-large.png -o blue-purple-pink-large.simple-filter.lossy.webp
dwebp -pgm blue-purple-pink-large.no-filter.lossy.webp -o tmp.pgm && convert tmp.pgm blue-purple-pink-large.no-filter.lossy.webp.ycbcr.png && rm tmp.pgm
dwebp -pgm blue-purple-pink-large.normal-filter.lossy.webp -o tmp.pgm && convert tmp.pgm blue-purple-pink-large.normal-filter.lossy.webp.ycbcr.png && rm tmp.pgm
dwebp -pgm blue-purple-pink-large.simple-filter.lossy.webp -o tmp.pgm && convert tmp.pgm blue-purple-pink-large.simple-filter.lossy.webp.ycbcr.png && rm tmp.pgm

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/106230044
2014-06-30 10:36:25 +10:00
Nigel Tao
0424e74a0e go.image/vp8: implement the normal filter.
The testdata was generated via:
cwebp foo.png -o foo.lossy.webp
dwebp -pgm foo.lossy.webp -o tmp.pgm
convert tmp.pgm foo.lossy.webp.ycbcr.png
rm tmp.pgm

TBR=r
R=r
CC=golang-codereviews
https://golang.org/cl/107330043
2014-06-26 13:29:30 +10:00
Nigel Tao
94ba43c478 go.image/vp8l: new package.
The blue-purple-pink image comes from
http://blog.golang.org/gophercon

The tux and yellow_rose images come from
https://developers.google.com/speed/webp/gallery2 and according to
that page, those images are in the public domain.

The gopher-doc images are http://golang.org/doc/gopher/doc.png
after quantizing its palette to 2/4/16/256 colors.

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/109010043
2014-06-17 21:51:57 +10:00
Nigel Tao
72be9c51b1 go.image/vp8: implement the loop filter.
The testdata files were created by:
cwebp video-001.png -o video-001.webp
dwebp -pgm video-001.webp -o tmp.pgm
convert tmp.pgm video-001.webp.ycbcr.png
rm tmp.pgm

LGTM=r
R=r
CC=chaishushan, golang-codereviews
https://golang.org/cl/91700044
2014-05-27 10:52:02 +10:00
Nigel Tao
f93749e6f2 go.image/vp8, go.image/webp: new packages, copied from
code.google.com/p/vp8-go

This is a straight copy, followed by import path updates.

LGTM=r
R=r, mirtchovski, oleku.konko
CC=golang-codereviews
https://golang.org/cl/79320043
2014-03-25 13:29:48 +11:00