浏览代码

Use image height to calculate watermark top offset (#313)

realsim 5 年之前
父节点
当前提交
f83b73ab38
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      process.go

+ 1 - 1
process.go

@@ -261,7 +261,7 @@ func prepareWatermark(wm *vipsImage, wmData *imageData, opts *watermarkOptions,
 		return wm.Replicate(imgWidth, imgHeight)
 	}
 
-	left, top := calcPosition(imgWidth, imgWidth, wm.Width(), wm.Height(), &opts.Gravity, true)
+	left, top := calcPosition(imgWidth, imgHeight, wm.Width(), wm.Height(), &opts.Gravity, true)
 
 	return wm.Embed(imgWidth, imgHeight, left, top, rgbColor{0, 0, 0})
 }