Created
September 25, 2014 12:46
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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