Skip to content

Instantly share code, notes, and snippets.

@KacperKozak
Last active December 16, 2015 19:29
Show Gist options
  • Save KacperKozak/5485361 to your computer and use it in GitHub Desktop.
Save KacperKozak/5485361 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ -e $1 ]
then
echo "Podaj rozmiar jako pierwszy argument"
else
if [ -e $2 ]
then
for file in $*
do
if [ $file != $1 ]
then
echo "Croping $file to $1"
mogrify -resize $1^ "$file"
mogrify -gravity Center -crop $1+0+0 "$file"
echo "OK!"
fi
done
else
echo "Gdzie się podziały pliki?!"
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment