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])