mirror of
https://github.com/talgo-cloud/bimg.git
synced 2026-03-07 13:38:16 -08:00
Use faster encoding setting in test
Add avif test photo, that I had forgotten
This commit is contained in:
parent
e87ff245c1
commit
5c3317d077
3 changed files with 4 additions and 4 deletions
|
|
@ -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
BIN
testdata/test.avif
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 253 KiB |
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue