Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # temporary file
- TMP=tmp.txt
- # size (width) of output png file (aspect-ratio is kept)
- WSIZE=16
- # destination direcotry where to move generated PNGs
- DEST=./pngs16
- echo "*********** STARTING CONVERSION **********"
- echo -n "Searching files... "
- find . -iname "*.svg" > $TMP
- num=$(wc -l < "$TMP")
- echo "$num .svg files found."
- # test line=./specific_applications/sonata/sonata_play.svg
- echo -n "Converting files"
- while read line
- do
- rsvg-convert -w $WSIZE -a -f png -o ${line%.svg}[w$WSIZE].png $line
- echo -n "."
- done <$TMP
- echo " "
- #echo "Press enter to continue..."
- #read
- echo " "
- echo -n "Searching converted png files..."
- find . -iname "*\[w$WSIZE\].png" > $TMP
- num2=$(wc -l < "$TMP")
- echo "$num2 files found."
- echo "Moving files to directory: $DEST"
- while read line
- do
- line2=${line//\//_}
- # echo "- file '${line}' to '$DEST/${line2#._}' "
- mv ${line} $DEST/${line2#._}
- echo -n "."
- done <$TMP
- echo " "
- echo " "
- echo "Removing temporary files."
- rm $TMP
- echo "***************** DONE *******************"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement