Elena & Fabrice's Web

Remove portrait images

Blog:Hacks

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

  1. #!/bin/bash
  2.  
  3. orientation=`exiftool -orientation "$1"`
  4.  
  5. echo "$1" has $orientation;
  6.  
  7. if ! [[ $orientation"Horizontal" ]]
  8. then
  9. echo "so removed";
  10. rm "$1";
  11. fi

You can run it recursively with:

  1. find directory/ -name "*.JPG" -exec ./rm-portrait {} \;



Find:
What links here (Remove portrait images) | Powered by GNU softwares & MediaWiki |
This page has been accessed 174 times. This page was last modified on 21 March 2012, at 16:17.