diff --git a/resize.go b/resize.go index 6e14960..72c517e 100644 --- a/resize.go +++ b/resize.go @@ -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)