From b4fae2dd5f27a23034beb48c055092f0e721b6dd Mon Sep 17 00:00:00 2001 From: Will Norris Date: Thu, 26 Dec 2013 08:23:27 -0800 Subject: [PATCH] properly resize when one dimension is specified --- transform/transform.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/transform/transform.go b/transform/transform.go index e1545cc..fdabc27 100644 --- a/transform/transform.go +++ b/transform/transform.go @@ -56,11 +56,11 @@ func Transform(img data.Image, opt *data.Options) (*data.Image, error) { } // resize - if opt.Width != 0 && opt.Height != 0 { + if w != 0 || h != 0 { if opt.Fit { m = imaging.Fit(m, w, h, imaging.Lanczos) } else { - if opt.Width == 0 || opt.Height == 0 { + if w == 0 || h == 0 { m = imaging.Resize(m, w, h, imaging.Lanczos) } else { m = imaging.Thumbnail(m, w, h, imaging.Lanczos)