refactor(重构代码): 提升代码水平
build.yaml / build (push) Successful in 33s

This commit is contained in:
2026-07-09 11:10:47 +08:00
parent fa3260c108
commit 9eb9104380
5 changed files with 119 additions and 40 deletions
+3
View File
@@ -1014,6 +1014,9 @@ func (r *Renderer) renderStamp(ctx *canvas.Context, s Stamp, pageH float64) {
// 入参: img 印章图片对象
// 返回: image.Image 处理后的印章图片对象
func stampImageWithTransparentWhite(img image.Image) image.Image {
if opaque, ok := img.(interface{ Opaque() bool }); ok && !opaque.Opaque() {
return img
}
bounds := img.Bounds()
out := image.NewNRGBA(bounds)
hasAlpha := false