Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- # Purpose: batch image resizer
- # Source: https://guides.wp-bullet.com
- # Author: Mike
- # absolute path to image folder
- FOLDER="/var/www/html/key_issue_api/stud_img"
- # max width
- WIDTH=540
- # max height
- HEIGHT=300
- #resize png or jpg to either height or width, keeps proportions using imagemagick
- #find ${FOLDER} -iname '*.jpg' -o -iname '*.png' -exec convert \{} -verbose -resize $WIDTHx$HEIGHT\> \{} \;
- #resize png to either height or width, keeps proportions using imagemagick
- #find ${FOLDER} -iname '*.png' -exec convert \{} -verbose -resize $WIDTHx$HEIGHT\> \{} \;
- #resize jpg only to either height or width, keeps proportions using imagemagick
- find ${FOLDER} -iname '*.jpg' -exec convert \{} -verbose -resize $WIDTHx$HEIGHT\> \{} \;
- # alternative
- #mogrify -path ${FOLDER} -resize ${WIDTH}x${HEIGHT}% *.png -verbose
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement