fix: allow SVG files in the convert tool

SVG files were rejected by the convert endpoint because
validateImageBuffer only recognized raster magic bytes. This adds
text-based SVG detection, sanitization in the tool factory, and
proper Sharp density handling so SVG-to-raster conversion works
through the standard convert route.
This commit is contained in:
Siddharth Kumar Sah
2026-03-30 11:37:09 +08:00
parent b1bfcbef9c
commit 4fa8dd0780
8 changed files with 270 additions and 41 deletions
+4
View File
@@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100">
<rect width="100" height="100" fill="#4a90d9"/>
<circle cx="50" cy="50" r="30" fill="#ffffff"/>
</svg>

After

Width:  |  Height:  |  Size: 195 B