allow speed from get (#383)

* allow speed from get

* updating the version to use effor param in libvips
This commit is contained in:
Vaibhav Sharma
2022-02-21 01:09:08 +05:30
committed by GitHub
parent e96c018103
commit 00f696fe3a
2 changed files with 8 additions and 0 deletions

View File

@@ -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 {

View File

@@ -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