Use faster encoding setting in test

Add avif test photo, that I had forgotten
This commit is contained in:
Lars Fronius 2020-10-14 13:55:13 +02:00
parent e87ff245c1
commit 5c3317d077
No known key found for this signature in database
GPG Key ID: 9799DF92255C2D0C
3 changed files with 4 additions and 4 deletions

View File

@ -226,7 +226,7 @@ type Options struct {
OutputICC string
InputICC string
Palette bool
// Speed defines the AVIF encoders CPU effort.
// Speed defines the AVIF encoders CPU effort. Valid values are 0-8.
Speed int
// private fields

BIN
testdata/test.avif vendored Normal file

Binary file not shown.

View File

@ -33,7 +33,7 @@ func TestVipsSave(t *testing.T) {
for _, typ := range types {
image, _, _ := vipsRead(readImage("test.jpg"))
options := vipsSaveOptions{Quality: 95, Type: typ, StripMetadata: true, Speed: 8}
options := vipsSaveOptions{Quality: 95, Type: typ, StripMetadata: true}
buf, err := vipsSave(image, options)
if err != nil {
@ -58,12 +58,12 @@ func TestVipsSaveTiff(t *testing.T) {
}
}
func TestVipsSafeAvif(t *testing.T) {
func TestVipsSaveAvif(t *testing.T) {
if !IsTypeSupportedSave(AVIF) {
t.Skipf("Format %#v is not supported", ImageTypes[AVIF])
}
image, _, _ := vipsRead(readImage("test.jpg"))
options := vipsSaveOptions{Quality: 95, Type: AVIF}
options := vipsSaveOptions{Quality: 95, Type: AVIF, Speed: 8}
buf, err := vipsSave(image, options)
if err != nil {
t.Fatalf("Error saving image type %v: %v", ImageTypes[AVIF], err)