Created
August 12, 2011 16:50
-
-
Save nuex/1142446 to your computer and use it in GitHub Desktop.
rlc - resize like crazy - resize all images in a directory recursively
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 | |
# | |
# rlc: resize like crazy | |
# | |
# rlc.sh targetdir | |
target=$1 | |
destination=$target-resized | |
dimensions=1000x | |
quality=100 | |
mkdir $destination | |
# echo usage if arguments do not exist | |
if [ -z "$target" ]; then | |
echo "rlc.sh targetdir" | |
exit 0 | |
fi | |
imagelist=imagelist.txt | |
# create image list | |
find $target/ -iname *.jpg -type f > $imagelist | |
gm mogrify -output-directory $destination -create-directories -resize $dimensions -quality $quality @$imagelist | |
rm $imagelist |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment