-
-
Save atlc/6a02e8daffbe0f2b71cc238a26e3e55a to your computer and use it in GitHub Desktop.
[bash] Resize image and create thumbnail with ImageMagick
This file contains hidden or 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