mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-10-10 20:22:31 +02:00
Fix feDropShadow SVG filter when IMGPROXY_SVG_FIX_UNSUPPORTED is true
This commit is contained in:
@@ -383,6 +383,21 @@ func handleProcessing(reqID string, rw http.ResponseWriter, r *http.Request) {
|
||||
))
|
||||
}
|
||||
|
||||
// We're going to rasterize SVG. Since librsvg lacks the support of some SVG
|
||||
// features, we're going to replace them to minimize rendering error
|
||||
if originData.Type == imagetype.SVG && config.SvgFixUnsupported {
|
||||
fixed, changed, svgErr := svg.FixUnsupported(originData)
|
||||
checkErr(ctx, "svg_processing", svgErr)
|
||||
|
||||
if changed {
|
||||
// Since we'll replace origin data, it's better to close it to return
|
||||
// it's buffer to the pool
|
||||
originData.Close()
|
||||
|
||||
originData = fixed
|
||||
}
|
||||
}
|
||||
|
||||
resultData, err := func() (*imagedata.ImageData, error) {
|
||||
defer metrics.StartProcessingSegment(ctx)()
|
||||
return processing.ProcessImage(ctx, originData, po)
|
||||
|
Reference in New Issue
Block a user