ImageMagick: Add border to portrait images
When taking pictures in both landscape and portrait orientation, all images from the same set might have to presented on the same format. E.g. on a digital picture frame. However, if the portrait images are kept as is, they will usually appear tilted 90 degrees on the frame. A quick and easy way to remedy this, is to add a border around the portrait images, so that they fit the same size as the ones on landscape form.
With the ImageMagick convert command, this is a one-step operation. And for a whole directory of images, it boils down to this one-liner. Based on the IM user guide.
for f in *; do echo $f; convert $f -auto-orient -thumbnail "1200x800>" -gravity center -background black -extent 1200x800 /tmp/$f; done