Last active
July 2, 2016 19:00
-
-
Save freundTech/c8dd85384cb7b26dc1e595b4c09f6629 to your computer and use it in GitHub Desktop.
Blubb-image-converter
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 | |
if [ ! -d "output" ] | |
then | |
mkdir "output" | |
fi | |
if [ ! -d "output/thumb" ] | |
then | |
mkdir "output/thumb" | |
fi | |
for f in $@ | |
do | |
if [ -f $f ] | |
then | |
filename=$(basename "$f") | |
test=`convert "$f" -format "%[fx:(w/h>1)?1:0]" info:` | |
if [ $test -eq 1 ]; then | |
convert "$f" -resize 700x "output/$filename" | |
convert "$f" -resize x48 -crop 72x48 "output/thumb/$filename" | |
else | |
convert "$f" -resize x467 "output/$filename" | |
convert "$f" -resize 72x -crop 72x48 "output/thumb/$filename" | |
fi | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment