Last active
January 17, 2017 21:20
-
-
Save agryson/6d63fad5125cfd30602bc420bc73fe3d to your computer and use it in GitHub Desktop.
Exports all svgs in the current folder to png's of the specified size (64px by default)
This file contains 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
#!/bin/bash | |
input=${1:-64} | |
#Creates output directory if it doesn't exist and empties it. | |
mkdir ~/Pictures/exportOutput | |
rm ~/Pictures/exportOutput/*.png | |
for file in *.svg | |
do | |
filename=$(basename "$file") | |
filename="${filename%.*}" | |
#This adds the size to the output, remove "_${input}" from the following filename if that's not desired | |
/usr/bin/inkscape -z "${file}" -w $input -h $input -e "~/Pictures/exportOutput/${filename}_${input}.png" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment