1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2025-01-18 11:12:10 +02:00

expand => extend

This commit is contained in:
DarthSim 2019-06-17 16:15:10 +06:00
parent 7d92cdd66d
commit 116ccc29e8
2 changed files with 4 additions and 4 deletions

View File

@ -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 { if err = img.Embed(gravityCenter, po.Width, po.Height, 0, 0, po.Background); err != nil {
return err return err
} }

View File

@ -103,7 +103,7 @@ type processingOptions struct {
Dpr float64 Dpr float64
Gravity gravityOptions Gravity gravityOptions
Enlarge bool Enlarge bool
Expand bool Extend bool
Crop cropOptions Crop cropOptions
Format imageType Format imageType
Quality int Quality int
@ -316,10 +316,10 @@ func applyEnlargeOption(po *processingOptions, args []string) error {
func applyExtendOption(po *processingOptions, args []string) error { func applyExtendOption(po *processingOptions, args []string) error {
if len(args) > 1 { 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 return nil
} }