Browse Source

Add resizing_type processing option

DarthSim 6 years ago
parent
commit
4f8bae755b
1 changed files with 21 additions and 3 deletions
  1. 21 3
      processing_options.go

+ 21 - 3
processing_options.go

@@ -203,9 +203,9 @@ func applySizeOption(po *processingOptions, args []string) (err error) {
 	return nil
 	return nil
 }
 }
 
 
-func applyResizeOption(po *processingOptions, args []string) error {
-	if len(args) > 4 {
-		return fmt.Errorf("Invalid resize arguments: %v", args)
+func applyResizingTypeOption(po *processingOptions, args []string) error {
+	if len(args) > 1 {
+		return fmt.Errorf("Invalid resizing type arguments: %v", args)
 	}
 	}
 
 
 	if r, ok := resizeTypes[args[0]]; ok {
 	if r, ok := resizeTypes[args[0]]; ok {
@@ -214,6 +214,20 @@ func applyResizeOption(po *processingOptions, args []string) error {
 		return fmt.Errorf("Invalid resize type: %s", args[0])
 		return fmt.Errorf("Invalid resize type: %s", args[0])
 	}
 	}
 
 
+	return nil
+}
+
+func applyResizeOption(po *processingOptions, args []string) error {
+	if len(args) > 4 {
+		return fmt.Errorf("Invalid resize arguments: %v", args)
+	}
+
+	if len(args[0]) > 0 {
+		if err := applyResizingTypeOption(po, args[0:1]); err != nil {
+			return err
+		}
+	}
+
 	if len(args) > 1 {
 	if len(args) > 1 {
 		if err := applySizeOption(po, args[1:]); err != nil {
 		if err := applySizeOption(po, args[1:]); err != nil {
 			return err
 			return err
@@ -356,6 +370,10 @@ func applyProcessingOption(po *processingOptions, name string, args []string) er
 		if err := applyResizeOption(po, args); err != nil {
 		if err := applyResizeOption(po, args); err != nil {
 			return err
 			return err
 		}
 		}
+	case "resizing_type":
+		if err := applyResizingTypeOption(po, args); err != nil {
+			return err
+		}
 	case "size":
 	case "size":
 		if err := applySizeOption(po, args); err != nil {
 		if err := applySizeOption(po, args); err != nil {
 			return err
 			return err