mirror of
https://github.com/talgo-cloud/bimg.git
synced 2026-03-07 21:48:13 -08:00
fix(resize): default options
This commit is contained in:
parent
a45e277f68
commit
5874efef3e
1 changed files with 3 additions and 2 deletions
|
|
@ -23,6 +23,9 @@ func Resize(buf []byte, o Options) ([]byte, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
// Define default options
|
||||
applyDefaults(&o, imageType)
|
||||
|
||||
if IsTypeSupported(o.Type) == false {
|
||||
return nil, errors.New("Unsupported image output type")
|
||||
}
|
||||
|
|
@ -32,8 +35,6 @@ func Resize(buf []byte, o Options) ([]byte, error) {
|
|||
inWidth := int(image.Xsize)
|
||||
inHeight := int(image.Ysize)
|
||||
|
||||
// Define default options
|
||||
applyDefaults(&o, imageType)
|
||||
// Infer the required operation based on the in/out image sizes for a coherent transformation
|
||||
normalizeOperation(&o, inWidth, inHeight)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue