Commit Graph

4 Commits

Author SHA1 Message Date
David Heuschmann
a9455cf03d image/bmp: support v4 and v5 info header versions
Decode BITMAPV4INFOHEADER and BITMAPV5INFOHEADER in addition to
BITMAPINFOHEADER and check if any of their features are used. If this is
not the case, the bmp can be decoded as if it had the BITMAPINFOHEADER.
Otherwise an ErrUnsupported is returned.

The colormap.bmp and yellow_rose-small-v5.bmp files were generated using
imagemagick using the following conversions:

convert video-001.bmp -depth 8 -palette colormap.bmp
convert yellow_rose-small.bmp -format BMP5 yellow_rose-small-v5.bmp

The corresponding png files were created using imagemagick convert
without any arguments.

Fixes golang/go#27767

Change-Id: I5c0138b231c68132d39a29c71b61faa546921511
Reviewed-on: https://go-review.googlesource.com/c/141799
Reviewed-by: Nigel Tao <nigeltao@golang.org>
Run-TryBot: Nigel Tao <nigeltao@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-10-23 22:58:01 +00:00
Nigel Tao
c73c2afc3b bmp: remove unused testing.T arg
Change-Id: I53954db3e83d3a5bb155fec24c7da0dc31b8ea2d
Reviewed-on: https://go-review.googlesource.com/122418
Reviewed-by: David Symonds <dsymonds@golang.org>
2018-07-08 00:43:52 +00:00
Nigel Tao
8d4fc1653b go.image/bmp: add a test image for top-down BMPs.
LGTM=ruiu
R=ruiu
CC=bsiegert, golang-codereviews
https://golang.org/cl/149090043
2014-10-01 09:41:12 +10:00
Nigel Tao
996c335c4a go.image/{bmp,tiff}: move tiff/testdata to testdata.
Add a "compare to golden PNG" test for BMP and TIFF.

R=rsc
CC=golang-dev
https://golang.org/cl/5601054
2012-01-31 14:02:27 +11:00