Handle 16-bit PNGs

This commit is contained in:
James Schofield 2016-11-03 17:44:53 -04:00
parent fd796251aa
commit 31a54299fb
3 changed files with 16 additions and 15 deletions

11
vips.go
View file

@ -55,6 +55,8 @@ type vipsSaveOptions struct {
Interlace bool
NoProfile bool
Interpretation Interpretation
Flatten bool
Background Color
}
type vipsWatermarkOptions struct {
@ -341,6 +343,15 @@ func vipsPreSave(image *C.VipsImage, o *vipsSaveOptions) (*C.VipsImage, error) {
image = outImage
}
// Flatten image on a background, if necessary
if o.Flatten {
var err error
if outImage, err = vipsFlattenBackground(image, o.Background); err != nil {
return nil, err
}
image = outImage
}
return image, nil
}