Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
if [ $1 ]; then FILENAME=$1; else exit; fi
BASENAME=$(basename -- $FILENAME)
NAME=${BASENAME%.*}
convert $FILENAME -auto-orient +profile "*" -write \
"mpr:source" -resize "1080x1080^" -gravity center -crop "1080x1080+0+0" +repage -write "$NAME-1080.jpg" +delete \
"mpr:source" -resize "720x720^" -gravity center -crop "720x720+0+0" +repage -write "$NAME-720.jpg" +delete \
"mpr:source" -resize "540x540^" -gravity center -crop "540x540+0+0" +repage -write "$NAME-540.jpg" +delete \
"mpr:source" -resize "360x360^" -gravity center -crop "360x360+0+0" +repage -write "$NAME-360.jpg" +delete \
"mpr:source" -resize "240x240^" -gravity center -crop "240x240+0+0" +repage -write "$NAME-240.jpg" +delete \
"mpr:source" -resize "120x120^" -gravity center -crop "120x120+0+0" +repage -write "$NAME-120.jpg" +delete \
"mpr:source" "$NAME-original.jpg"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.