Jelajahi Sumber

Fix dpr+extend

DarthSim 4 tahun lalu
induk
melakukan
06b61af2a8
1 mengubah file dengan 3 tambahan dan 3 penghapusan
  1. 3 3
      process.go

+ 3 - 3
process.go

@@ -474,9 +474,9 @@ func transformImage(ctx context.Context, img *vipsImage, data []byte, po *proces
 		return err
 		return err
 	}
 	}
 
 
-	if po.Extend.Enabled && (po.Width > img.Width() || po.Height > img.Height()) {
-		offX, offY := calcPosition(po.Width, po.Height, img.Width(), img.Height(), &po.Extend.Gravity, false)
-		if err = img.Embed(po.Width, po.Height, offX, offY, po.Background, transparentBg); err != nil {
+	if po.Extend.Enabled && (dprWidth > img.Width() || dprHeight > img.Height()) {
+		offX, offY := calcPosition(dprWidth, dprHeight, img.Width(), img.Height(), &po.Extend.Gravity, false)
+		if err = img.Embed(dprWidth, dprHeight, offX, offY, po.Background, transparentBg); err != nil {
 			return err
 			return err
 		}
 		}
 	}
 	}