From 5874efef3ebbc5357d635c2d5a24d7fb12bb5071 Mon Sep 17 00:00:00 2001 From: Tomas Aparicio Date: Thu, 9 Jul 2015 23:35:04 +0100 Subject: [PATCH] fix(resize): default options --- resize.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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)