Advertisement
zopper

SVG to PNG convert

Mar 31st, 2013
320
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.53 KB | None | 0 0
  1. #!/bin/bash
  2. # SVG to png convertor
  3. # export files in two sizes
  4.  
  5.  
  6. SIZE_BIG=34
  7. SIZE_SMALL=28
  8.  
  9. mkdir $SIZE_BIG 2>/dev/null
  10. mkdir $SIZE_SMALL 2>/dev/null
  11.  
  12. SAVEIFS=$IFS
  13. IFS=$(echo -en "\n\b")
  14.  
  15. for ITEM in *.svg;do
  16.         ITEM=`echo "$ITEM" | sed "s/\.svg$//"`
  17.         inkscape "$ITEM.svg" --export-png="$SIZE_BIG/$ITEM.png" --export-width=$SIZE_BIG --export-height=$SIZE_BIG
  18.         inkscape "$ITEM.svg" --export-png="$SIZE_SMALL/$ITEM.png" --export-width=$SIZE_SMALL --export-height=$SIZE_SMALL
  19. done
  20.  
  21. IFS=$SAVEIFS
  22.  
  23. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement