xseticon icon indicating copy to clipboard operation
xseticon copied to clipboard

SVG support

Open thenoobtester opened this issue 3 years ago • 2 comments

Hi,

does this support svg image files? I tried and got a segmentation fault error, so I don't know if it's because I used a svg file or something else.

Thank you :)

thenoobtester avatar Oct 05 '21 19:10 thenoobtester

Hello,

Unfortunately this doesn't work with SVG.

The code explicitly expects PNG and nothing else. It looks fairly easy to support some other bitmap formats, but there is no simple way I see to support SVG.

Your best bet then would be to first convert the SVG to PNG using ImageMagick (convert) or InkScape. For instance, from https://stackoverflow.com/questions/9853325/how-to-convert-a-svg-to-a-png-with-imagemagick:

convert -size 1024x1024 test.svg test.png            # ImageMagick
inkscape -z -w 1024 -h 1024 input.svg -e output.png  # Inkscape
inkscape -w 1024 -h 1024 input.svg -o output.png     # InkScape 1.0

xeyownt avatar Oct 07 '21 10:10 xeyownt

This Pull Request adds support to multiple image files including .svg

ahsand97 avatar Dec 19 '21 03:12 ahsand97