xeyownt / xseticon

xseticon from Paul Evans -- http://www.leonerd.org.uk/
GNU General Public License v2.0
32 stars 11 forks source link

SVG support #8

Open thenoobtester opened 2 years ago

thenoobtester commented 2 years ago

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 :)

xeyownt commented 2 years ago

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
ahsand97 commented 2 years ago

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