Sfoglia il codice sorgente

Fix enlarge protection when image data is not provided

DarthSim 2 settimane fa
parent
commit
5ac82cec34
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  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