瀏覽代碼

expand => extend

DarthSim 5 年之前
父節點
當前提交
116ccc29e8
共有 2 個文件被更改,包括 4 次插入4 次删除
  1. 1 1
      process.go
  2. 3 3
      processing_options.go

+ 1 - 1
process.go

@@ -329,7 +329,7 @@ func transformImage(ctx context.Context, img *vipsImage, data []byte, po *proces
 		}
 	}
 
-	if po.Expand && (po.Width > img.Width() || po.Height > img.Height()) {
+	if po.Extend && (po.Width > img.Width() || po.Height > img.Height()) {
 		if err = img.Embed(gravityCenter, po.Width, po.Height, 0, 0, po.Background); err != nil {
 			return err
 		}

+ 3 - 3
processing_options.go

@@ -103,7 +103,7 @@ type processingOptions struct {
 	Dpr        float64
 	Gravity    gravityOptions
 	Enlarge    bool
-	Expand     bool
+	Extend     bool
 	Crop       cropOptions
 	Format     imageType
 	Quality    int
@@ -316,10 +316,10 @@ func applyEnlargeOption(po *processingOptions, args []string) error {
 
 func applyExtendOption(po *processingOptions, args []string) error {
 	if len(args) > 1 {
-		return fmt.Errorf("Invalid expand arguments: %v", args)
+		return fmt.Errorf("Invalid extend arguments: %v", args)
 	}
 
-	po.Expand = args[0] != "0"
+	po.Extend = args[0] != "0"
 
 	return nil
 }