Skip to content

Instantly share code, notes, and snippets.

@weivall
Created April 13, 2015 07:52
Show Gist options
  • Save weivall/53eaf512c0b7d7572885 to your computer and use it in GitHub Desktop.
Save weivall/53eaf512c0b7d7572885 to your computer and use it in GitHub Desktop.
svg resize inkscape
#!/bin/bash
INK=/Applications/Inkscape.app/Contents/Resources/bin/inkscape
if [[ -z "$1" ]]
then
echo "SVG file needed."
exit;
fi
BASE=`basename "$1" .svg`
SVG="$1"
# favicon tmpl 16pt
$INK -z -C -e "favicon.ico" -f $SVG -w 16 -h 16
# iPhone Spotlight iOS5,6 Settings iOS and iPad 5-7 29pt
$INK -z -C -e "$BASE-29.png" -f $SVG -w 29 -h 29
$INK -z -C -e "[email protected]" -f $SVG -w 58 -h 58
# iPhone Spotlight iOS7 40pt
$INK -z -C -e "[email protected]" -f $SVG -w 80 -h 80
# iPhone App iOS 5,6 57pt
$INK -z -C -e "$BASE-57.png" -f $SVG -w 57 -h 57
$INK -z -C -e "[email protected]" -f $SVG -w 114 -h 114
# iPad Spotlight iOS 7 40pt
$INK -z -C -e "$BASE-40.png" -f $SVG -w 40 -h 40
# iPad Spotlight iOS 5,6 50pt
$INK -z -C -e "$BASE-50.png" -f $SVG -w 50 -h 50
$INK -z -C -e "[email protected]" -f $SVG -w 100 -h 100
# iPad App iOS 5,6 72pt
$INK -z -C -e "$BASE-72.png" -f $SVG -w 72 -h 72
$INK -z -C -e "[email protected]" -f $SVG -w 144 -h 144
# iPad App iOS 7,8 60pt
$INK -z -C -e "[email protected]" -f $SVG -w 120 -h 120
$INK -z -C -e "[email protected]" -f $SVG -w 180 -h 180
#iTunes Artwork
$INK -z -C -e "$BASE-512.png" -f $SVG -w 512 -h 512
$INK -z -C -e "$BASE-1024.png" -f $SVG -w 1024 -h 1024
cp "$BASE-512.png" iTunesArtwork.png
cp "$BASE-1024.png" [email protected]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment