#!/bin/sh

USAGE='Usage: brewrot <image-files>

  Rotate image-files based on exif-information, preserving EXIF-tags and ICC profile.

  Depends on jhead and exiftool.

  Copyright © Daniel Ljunggren <foto@demulsion.se>. Feb 2008.

'

for FILE 
do
  if [ -w "$FILE" ]; then
      #exiftool -icc_profile -b $FILE > icc # Preserve icc-profile.
      /usr/local/bin/jhead -autorot $FILE
      #exiftool "-icc_profile<=icc" -overwrite_original $FILE
      #rm icc
 fi
done
