瀏覽代碼

Fix SVG loading support check

DarthSim 5 年之前
父節點
當前提交
72049f3b88
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      process.go

+ 4 - 0
process.go

@@ -580,6 +580,10 @@ func processImage(ctx context.Context) ([]byte, context.CancelFunc, error) {
 		return imgdata.Data, func() {}, nil
 	}
 
+	if imgdata.Type == imageTypeSVG && !vipsTypeSupportLoad[imageTypeSVG] {
+		return []byte{}, func() {}, errSourceImageTypeNotSupported
+	}
+
 	if !vipsSupportSmartcrop {
 		if po.Gravity.Type == gravitySmart {
 			logWarning(msgSmartCropNotSupported)