#!/bin/sh ## Resize given images to 2000px width and merge them into one image below each other. ## The result image quality will be reduced to hit the ~1000kb mark. ## Script was created as workaround forum upload restrictions in size and number of images. readlink -f $1 > /dev/null 2>&1 \ || { echo "Invalid or missing argument"; exit 1; } for i in $@ do list="$list ( $i -resize 2000x )" done file="IMG_$(date +"%Y%m%d%M%S").jpg" convert $list \ -background white \ -gravity Center \ -smush +6 \ -define jpeg:extent=1000kb \ $file \ && echo "Result: $PWD/$file ($file)"