Created
February 8, 2018 19:04
-
-
Save sodonnell/9f2c1900efe48e7ea1de310cfaef0ac0 to your computer and use it in GitHub Desktop.
Resize an image and constrain the image proportionately to a specified width, using ImageMagick (convert) from the command line.
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
#!/usr/bin/env bash | |
# | |
# The gist example here does not perform any sanity or error checking. It's just a gist. | |
# | |
# example: resize an image file to 150px width... | |
# ./convert.sh example.jpg 150 | |
# | |
$FILENAME=$1 | |
$WIDTH=$2 | |
convert -geometry $WIDTH $FILENAME $FILENAME; | |
echo -e "\nDone!\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment