- Adding a Background option when flattening out a transparent PNG

This commit is contained in:
Clement DAL PALU 2015-09-28 17:33:38 -07:00
parent ebb3688b44
commit e83c80c93c
5 changed files with 42 additions and 0 deletions

View file

@ -246,6 +246,19 @@ func TestImageConvert(t *testing.T) {
Write("fixtures/test_image_convert_out.png", buf)
}
func TestTransparentImageConvert(t *testing.T) {
image := initImage("transparent.png")
options := Options{
Type: JPEG,
Background: Color{255, 255, 255},
}
buf, err := image.Process(options)
if err != nil {
t.Errorf("Cannot process the image: %#v", err)
}
Write("fixtures/test_transparent_image_convert_out.jpg", buf)
}
func TestImageMetadata(t *testing.T) {
data, err := initImage("test.png").Metadata()
if err != nil {