add support for bmp images

handle decoding and encoding bmp images with transformations.  Because
this isn't a popular file format, we don't actually expose it as an
option for format transformation.

Fixes #182
This commit is contained in:
Will Norris 2019-06-11 04:20:46 +00:00
parent 1569bfda30
commit d4ba5205ff
2 changed files with 9 additions and 0 deletions

View file

@ -28,6 +28,7 @@ import (
"testing"
"github.com/disintegration/imaging"
"golang.org/x/image/bmp"
)
var (
@ -111,6 +112,7 @@ func TestTransform(t *testing.T) {
encode func(io.Writer, image.Image)
exactOutput bool // whether input and output should match exactly
}{
{"bmp", func(w io.Writer, m image.Image) { bmp.Encode(w, m) }, true},
{"gif", func(w io.Writer, m image.Image) { gif.Encode(w, m, nil) }, true},
{"jpeg", func(w io.Writer, m image.Image) { jpeg.Encode(w, m, nil) }, false},
{"png", func(w io.Writer, m image.Image) { png.Encode(w, m) }, true},