Closed D10f closed 1 year ago
Traced this down to an issue with imagemagick itself while handling certain SVGs with complex instructions. Resorted to install Inkscape as a workaround. See here: https://github.com/ImageMagick/ImageMagick/discussions/6831
Hi, I'm running the following code:
But the output of that is not the expected image file, but an empty one. The input SVG that causes this is the Vite favicon found at
https://vitejs.dev/logo.svg
. Other SVG files seem to work perfectly fine, for example others from similar projects found athttps://vuejs.org/logo.svg
orhttps://pinia.vuejs.org/logo.svg
. I tried encoding into multiple other formats, different variations of the constraints as provided by the third parameter function, different sizes, no sizes at all, etc... Nothing works.Trying to convert the same file with ImageMagick directly throws the following error:
However this only seems to happen when converting to
ico
, other formats work perfectly. Interestingly when resizing the image at the same time it works fine:Examining the SVG in question there are width and height attributes, 410x404 respectively at the time of this writing. Shrinking those values manually and then trying to convert them again solves the issue but the image is lost due to the viewport shift. Not that a 400x400 image is too large in any case.
PHP version is 8.2 Intervention/image is 2.7
Please let me know if I should provide any other details. Thank you.