瀏覽代碼

Fix enlarge protection when image data is not provided

DarthSim 2 周之前
父節點
當前提交
5ac82cec34
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      processing/prepare.go

+ 3 - 1
processing/prepare.go

@@ -109,7 +109,9 @@ func (pctx *Context) calcScale(width, height int, po *options.ProcessingOptions)
 
 	pctx.DprScale = po.Dpr
 
-	if !po.Enlarge && pctx.ImgData != nil && !pctx.ImgData.Format().IsVector() {
+	isVector := pctx.ImgData != nil && pctx.ImgData.Format().IsVector()
+
+	if !po.Enlarge && !isVector {
 		minShrink := math.Min(wshrink, hshrink)
 		if minShrink < 1 {
 			wshrink /= minShrink