Sfoglia il codice sorgente

Fix SVG loading support check

DarthSim 5 anni fa
parent
commit
72049f3b88
1 ha cambiato i file con 4 aggiunte e 0 eliminazioni
  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)