Skip to content

Instantly share code, notes, and snippets.

@troyane
Created September 25, 2014 12:46
Show Gist options
  • Save troyane/dcb67c5af2e8a175fd79 to your computer and use it in GitHub Desktop.
Save troyane/dcb67c5af2e8a175fd79 to your computer and use it in GitHub Desktop.
Batch converter from svg to png with different DPI + preparing part of file to add to
# Autrhor Nazar `tro` Gerasymchuk
#!/bin/bash
dpis=(90 135 180 270 360 540)
for dir in ${dpis[@]}
do
mkdir ${dir}
done
touch resources_part.qrc
for file in `ls $PWD/original/*.svg`
do
for dpi in ${dpis[@]}
do
filename=$(basename "$file")
filename="${filename%.*}"
/usr/bin/inkscape -z -d ${dpi} -f ${file} -e "${dpi}/$filename.png"
echo "<file>img/${dpi}/$filename.png</file>" >> resources_part.qrc
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment