Last active
October 11, 2016 12:00
-
-
Save dmy3k/ca8e901cbd32d16d44e478c7d8f272aa to your computer and use it in GitHub Desktop.
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/sh | |
#--------------------------------------------------------------- | |
# Creates png files from given svg files in a directory. | |
# Target png dimensions hardcoded (120px width, height auto). | |
# Note: you need to `npm install -g svgexport` first. | |
# | |
# Usage example: | |
# ./svgrasterize.sh . | |
#--------------------------------------------------------------- | |
FILES=$(find $1 -maxdepth 1 -name '*.svg') | |
for file in $FILES | |
do | |
extension="${file##*.}" | |
filename="${file%.*}" | |
svgexport "$file" "png/$filename.png" 120: | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment