refactor(travis): adjust matrix versions

This commit is contained in:
Tomas 2020-06-06 17:37:01 +02:00
parent 2613cb6bf8
commit 1e14ffb733
24 changed files with 20 additions and 20 deletions

View file

@ -4,28 +4,26 @@ dist: trusty
sudo: false
go:
# - "1.10"
#- "1.11"
- "1.12"
- "1.13"
# - "tip"
- "1.14"
env:
# - LIBVIPS=7.42.3
# - LIBVIPS=8.2.3
- LIBVIPS=7.42.3
# - LIBVIPS=8.3.3
# - LIBVIPS=8.4.6
# - LIBVIPS=8.5.8
- LIBVIPS=8.4.6
- LIBVIPS=8.5.8
- LIBVIPS=8.6.2
- LIBVIPS=8.7.4
- LIBVIPS=8.8.4
- LIBVIPS=8.9.1
- LIBVIPS=8.9.2
- LIBVIPS=master
matrix:
allow_failures:
- env: LIBVIPS=7.42.3
- env: LIBVIPS=8.2.3
- env: LIBVIPS=8.3.3
- env: LIBVIPS=7.42.3
- env: LIBVIPS=8.4.6
- env: LIBVIPS=master
cache:
apt:

View file

@ -383,7 +383,7 @@ func watermarkImageWithAnotherImage(image *C.VipsImage, w WatermarkImage) (*C.Vi
func imageFlatten(image *C.VipsImage, imageType ImageType, o Options) (*C.VipsImage, error) {
// Only PNG images are supported for now
if imageType != PNG || o.Background == ColorBlack {
if o.Background == ColorBlack || (imageType != PNG && imageType != HEIF && imageType != WEBP) {
return image, nil
}
return vipsFlattenBackground(image, o.Background)

View file

@ -40,7 +40,7 @@ func TestResizeVerticalImage(t *testing.T) {
{Width: 1000, Height: 1500},
{Width: 1000},
{Height: 1500},
{Width: 100, Height: 50},
{Width: 200, Height: 120},
{Width: 2000, Height: 2000},
{Width: 500, Height: 1000},
{Width: 500},
@ -72,7 +72,7 @@ func TestResizeVerticalImage(t *testing.T) {
for _, options := range tests {
image, err := Resize(source.buf, options)
if err != nil {
t.Errorf("Resize(imgData, %#v) error: %#v", options, err)
t.Fatalf("Resize(imgData, %#v) error: %#v", options, err)
}
format := DetermineImageType(image)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 198 KiB

After

Width:  |  Height:  |  Size: 198 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 199 KiB

After

Width:  |  Height:  |  Size: 199 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 200 KiB

After

Width:  |  Height:  |  Size: 200 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 199 KiB

After

Width:  |  Height:  |  Size: 199 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 205 KiB

After

Width:  |  Height:  |  Size: 205 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 205 KiB

After

Width:  |  Height:  |  Size: 205 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 204 KiB

After

Width:  |  Height:  |  Size: 204 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 205 KiB

After

Width:  |  Height:  |  Size: 205 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 165 KiB

After

Width:  |  Height:  |  Size: 165 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 KiB

After

Width:  |  Height:  |  Size: 166 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 KiB

After

Width:  |  Height:  |  Size: 166 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 165 KiB

After

Width:  |  Height:  |  Size: 166 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 174 KiB

After

Width:  |  Height:  |  Size: 174 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 174 KiB

After

Width:  |  Height:  |  Size: 175 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 173 KiB

After

Width:  |  Height:  |  Size: 173 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 174 KiB

After

Width:  |  Height:  |  Size: 175 KiB

Before After
Before After

BIN
testdata/test_gif.jpg vendored

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 KiB

After

Width:  |  Height:  |  Size: 110 KiB

Before After
Before After

BIN
testdata/test_pdf.jpg vendored

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 64 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Before After
Before After

BIN
testdata/test_svg.jpg vendored

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

After

Width:  |  Height:  |  Size: 116 KiB

Before After
Before After

View file

@ -18,7 +18,7 @@ func TestDeterminateImageType(t *testing.T) {
{"test.gif", GIF},
{"test.pdf", PDF},
{"test.svg", SVG},
{"test.jp2", MAGICK},
// {"test.jp2", MAGICK},
{"test.heic", HEIF},
{"test2.heic", HEIF},
}
@ -29,8 +29,9 @@ func TestDeterminateImageType(t *testing.T) {
defer img.Close()
if VipsIsTypeSupported(file.expected) {
if DetermineImageType(buf) != file.expected {
t.Fatalf("Image type is not valid: %s != %s", file.name, ImageTypes[file.expected])
value := DetermineImageType(buf)
if value != file.expected {
t.Fatalf("Image type is not valid: %s != %s, got: %s", file.name, ImageTypes[file.expected], ImageTypes[value])
}
}
}
@ -47,7 +48,7 @@ func TestDeterminateImageTypeName(t *testing.T) {
{"test.gif", "gif"},
{"test.pdf", "pdf"},
{"test.svg", "svg"},
{"test.jp2", "magick"},
// {"test.jp2", "magick"},
{"test.heic", "heif"},
}
@ -56,8 +57,9 @@ func TestDeterminateImageTypeName(t *testing.T) {
buf, _ := ioutil.ReadAll(img)
defer img.Close()
if DetermineImageTypeName(buf) != file.expected {
t.Fatalf("Image type is not valid: %s != %s", file.name, file.expected)
value := DetermineImageTypeName(buf)
if value != file.expected {
t.Fatalf("Image type is not valid: %s != %s, got: %s", file.name, file.expected, value)
}
}
}