mirror of
https://github.com/talgo-cloud/bimg.git
synced 2026-03-11 00:10:27 -07:00
refactor(vips): switch option
This commit is contained in:
parent
6702817185
commit
6ca9bed996
1 changed files with 3 additions and 3 deletions
6
vips.go
6
vips.go
|
|
@ -226,11 +226,11 @@ func vipsSave(image *C.struct__VipsImage, o vipsSaveOptions) ([]byte, error) {
|
|||
|
||||
defer C.g_object_unref(C.gpointer(image))
|
||||
|
||||
switch {
|
||||
case o.Type == PNG:
|
||||
switch o.Type {
|
||||
case PNG:
|
||||
err = C.vips_pngsave_bridge(image, &ptr, &length, 1, C.int(o.Compression), C.int(o.Quality), 0)
|
||||
break
|
||||
case o.Type == WEBP:
|
||||
case WEBP:
|
||||
err = C.vips_webpsave_bridge(image, &ptr, &length, 1, C.int(o.Quality), 0)
|
||||
break
|
||||
default:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue