<span class="mw-page-title-namespace">Blog</span><span class="mw-page-title-separator">:</span><span class="mw-page-title-main">Hacks/Remove portrait images</span>
Elena & Fabrice's Web

Remove portrait images

From laussy.org's Blog about Hacks.
Published: 17:39, 21 December 2011.

This little script removes images which appear to be in the portrait format (tweak it for your own needs).

#!/bin/bash

orientation=`exiftool -orientation "$1"`

echo "$1" has $orientation;

if ! $orientation =~ "Horizontal" then

   echo "so removed";
   rm "$1";

fi

You can run it recursively with: find directory/ -name "*.JPG" -exec ./rm-portrait {} \;