|
@@ -203,9 +203,9 @@ func applySizeOption(po *processingOptions, args []string) (err error) {
|
|
|
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 {
|
|
@@ -214,6 +214,20 @@ func applyResizeOption(po *processingOptions, args []string) error {
|
|
|
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 err := applySizeOption(po, args[1:]); err != nil {
|
|
|
return err
|
|
@@ -356,6 +370,10 @@ func applyProcessingOption(po *processingOptions, name string, args []string) er
|
|
|
if err := applyResizeOption(po, args); err != nil {
|
|
|
return err
|
|
|
}
|
|
|
+ case "resizing_type":
|
|
|
+ if err := applyResizingTypeOption(po, args); err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
case "size":
|
|
|
if err := applySizeOption(po, args); err != nil {
|
|
|
return err
|