diff --git a/options.go b/options.go index 248fbe3..3d46fb2 100644 --- a/options.go +++ b/options.go @@ -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 diff --git a/testdata/test.avif b/testdata/test.avif new file mode 100644 index 0000000..d37c273 Binary files /dev/null and b/testdata/test.avif differ diff --git a/vips_test.go b/vips_test.go index 00c1987..97e0284 100644 --- a/vips_test.go +++ b/vips_test.go @@ -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)