diff --git a/Dockerfile b/Dockerfile index 3f33d2e7..1f2d697c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ ARG GOLANG_VERSION=1.17 FROM golang:${GOLANG_VERSION}-buster as builder ARG IMAGINARY_VERSION=dev -ARG LIBVIPS_VERSION=8.10.0 +ARG LIBVIPS_VERSION=8.12.2 ARG GOLANGCILINT_VERSION=1.29.0 # Installs libvips + required libraries diff --git a/options.go b/options.go index b69fb881..bc639c59 100644 --- a/options.go +++ b/options.go @@ -44,6 +44,7 @@ type ImageOptions struct { Color []uint8 Background []uint8 Interlace bool + Speed int Extend bimg.Extend Gravity bimg.Gravity Colorspace bimg.Interpretation @@ -144,6 +145,7 @@ func BimgOptions(o ImageOptions) bimg.Options { Rotate: bimg.Angle(o.Rotate), Interlace: o.Interlace, Palette: o.Palette, + Speed: o.Speed, } if len(o.Background) != 0 { diff --git a/params.go b/params.go index ddc200e4..8d133b7b 100644 --- a/params.go +++ b/params.go @@ -56,6 +56,7 @@ var paramTypeCoercions = map[string]Coercion{ "interlace": coerceInterlace, "aspectratio": coerceAspectRatio, "palette": coercePalette, + "speed": coerceSpeed, } func coerceTypeInt(param interface{}) (int, error) { @@ -350,6 +351,11 @@ func coercePalette(io *ImageOptions, param interface{}) (err error) { return err } +func coerceSpeed(io *ImageOptions, param interface{}) (err error) { + io.Speed, err = coerceTypeInt(param) + return err +} + func buildParamsFromOperation(op PipelineOperation) (ImageOptions, error) { var options ImageOptions