refactor(travis): adjust matrix versions
20
.travis.yml
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
BIN
testdata/exif/Landscape_1_out.jpg
vendored
|
Before Width: | Height: | Size: 198 KiB After Width: | Height: | Size: 198 KiB |
BIN
testdata/exif/Landscape_2_out.jpg
vendored
|
Before Width: | Height: | Size: 199 KiB After Width: | Height: | Size: 199 KiB |
BIN
testdata/exif/Landscape_3_out.jpg
vendored
|
Before Width: | Height: | Size: 200 KiB After Width: | Height: | Size: 200 KiB |
BIN
testdata/exif/Landscape_4_out.jpg
vendored
|
Before Width: | Height: | Size: 199 KiB After Width: | Height: | Size: 199 KiB |
BIN
testdata/exif/Landscape_5_out.jpg
vendored
|
Before Width: | Height: | Size: 205 KiB After Width: | Height: | Size: 205 KiB |
BIN
testdata/exif/Landscape_6_out.jpg
vendored
|
Before Width: | Height: | Size: 205 KiB After Width: | Height: | Size: 205 KiB |
BIN
testdata/exif/Landscape_7_out.jpg
vendored
|
Before Width: | Height: | Size: 204 KiB After Width: | Height: | Size: 204 KiB |
BIN
testdata/exif/Landscape_8_out.jpg
vendored
|
Before Width: | Height: | Size: 205 KiB After Width: | Height: | Size: 205 KiB |
BIN
testdata/exif/Portrait_1_out.jpg
vendored
|
Before Width: | Height: | Size: 165 KiB After Width: | Height: | Size: 165 KiB |
BIN
testdata/exif/Portrait_2_out.jpg
vendored
|
Before Width: | Height: | Size: 166 KiB After Width: | Height: | Size: 166 KiB |
BIN
testdata/exif/Portrait_3_out.jpg
vendored
|
Before Width: | Height: | Size: 166 KiB After Width: | Height: | Size: 166 KiB |
BIN
testdata/exif/Portrait_4_out.jpg
vendored
|
Before Width: | Height: | Size: 165 KiB After Width: | Height: | Size: 166 KiB |
BIN
testdata/exif/Portrait_5_out.jpg
vendored
|
Before Width: | Height: | Size: 174 KiB After Width: | Height: | Size: 174 KiB |
BIN
testdata/exif/Portrait_6_out.jpg
vendored
|
Before Width: | Height: | Size: 174 KiB After Width: | Height: | Size: 175 KiB |
BIN
testdata/exif/Portrait_7_out.jpg
vendored
|
Before Width: | Height: | Size: 173 KiB After Width: | Height: | Size: 173 KiB |
BIN
testdata/exif/Portrait_8_out.jpg
vendored
|
Before Width: | Height: | Size: 174 KiB After Width: | Height: | Size: 175 KiB |
BIN
testdata/test_gif.jpg
vendored
|
Before Width: | Height: | Size: 111 KiB After Width: | Height: | Size: 110 KiB |
BIN
testdata/test_pdf.jpg
vendored
|
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 64 KiB |
BIN
testdata/test_smart_crop.jpg
vendored
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 24 KiB |
BIN
testdata/test_svg.jpg
vendored
|
Before Width: | Height: | Size: 117 KiB After Width: | Height: | Size: 116 KiB |
14
type_test.go
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||