Created
November 16, 2017 20:55
-
-
Save kazzkiq/f850f33a5056252e88944944bc87758d to your computer and use it in GitHub Desktop.
[bash] Resize image and create thumbnail with ImageMagick
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
INDEX_RESIZE=0 | |
for file in ./*.jpg; do | |
[ -e "$file" ] || continue | |
convert $file -resize 1000x1000^ $file | |
let INDEX_RESIZE=$(expr $INDEX_RESIZE+1) | |
done | |
INDEX_THUMBNAIL=0 | |
for file in ./*.jpg; do | |
[ -e "$file" ] || continue | |
convert $file -resize 200x200^ ${INDEX_THUMBNAIL}-thumbnail.jpg | |
let INDEX_THUMBNAIL=$(expr $INDEX_THUMBNAIL+1) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
More info: http://www.imagemagick.org/Usage/resize/