mirror of
https://github.com/h2non/imaginary.git
synced 2025-12-13 20:37:04 +01:00
allow speed from get (#383)
* allow speed from get * updating the version to use effor param in libvips
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user