From e7e296aa93867d8e1e4b98ac55c7a6511fb32eff Mon Sep 17 00:00:00 2001 From: DarthSim Date: Tue, 11 Sep 2018 17:22:19 +0600 Subject: [PATCH] Fix width & height checking --- processing_options.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/processing_options.go b/processing_options.go index 6968ad72..db99b5e5 100644 --- a/processing_options.go +++ b/processing_options.go @@ -110,7 +110,7 @@ func applyWidthOption(po *processingOptions, args []string) error { return fmt.Errorf("Invalid width arguments: %v", args) } - if w, err := strconv.Atoi(args[0]); err == nil || w >= 0 { + if w, err := strconv.Atoi(args[0]); err == nil && w >= 0 { po.Width = w } else { return fmt.Errorf("Invalid width: %s", args[0]) @@ -124,7 +124,7 @@ func applyHeightOption(po *processingOptions, args []string) error { return fmt.Errorf("Invalid height arguments: %v", args) } - if h, err := strconv.Atoi(args[0]); err == nil || po.Height >= 0 { + if h, err := strconv.Atoi(args[0]); err == nil && po.Height >= 0 { po.Height = h } else { return fmt.Errorf("Invalid height: %s", args[0])