Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ type ImageOptions struct {
Color []uint8
Background []uint8
Interlace bool
Speed int
Extend bimg.Extend
Gravity bimg.Gravity
Colorspace bimg.Interpretation
Expand Down Expand Up @@ -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 {
Expand Down
6 changes: 6 additions & 0 deletions params.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ var paramTypeCoercions = map[string]Coercion{
"interlace": coerceInterlace,
"aspectratio": coerceAspectRatio,
"palette": coercePalette,
"speed": coerceSpeed,
}

func coerceTypeInt(param interface{}) (int, error) {
Expand Down Expand Up @@ -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

Expand Down