mirror of
https://github.com/talgo-cloud/bimg.git
synced 2026-03-09 07:28:44 -07:00
- Adding a Background option when flattening out a transparent PNG
This commit is contained in:
parent
ebb3688b44
commit
e83c80c93c
5 changed files with 42 additions and 0 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue