#!/bin/csh -f # rotateimages # ------------------------------------------------------------------------- # C shell script to open the specified images and allow the user to rotate # them # ------------------------------------------------------------------------- # Revision History: # $Log$ # ------------------------------------------------------------------------- if ($#argv == 0 || $1:q == "-h" || $1:q == "--help") then echo "Usage: $0:t image_file..." exit 1 endif # Open Preview app, allowing the user to rotate each image # Note: If Preview's Inspector was open last time Preview showed an # image, it opens again automatically, at the same tab as before. # Otherwise, the user should open Inspector via Cmd-I. # The General tab of Inspector shows the internal "Orientation" # value of the current image. # If not "1 (Normal)", the user should rotate the image manually # via Cmd-R, even if it visually appears to be properly oriented. # Then rotate back via Cmd-L until it visually appears to be # properly oriented. # Those 2 manual steps strip out the "Orientation" value embedded # in the image, or at least set it to "1 (Normal)". # The change to the "Orientation" value may NOT be immediately # apparent in Inspector, which may continue to shows the original # "Orientation" value that the image had when opened by Inspector # (a bug in Preview, I think). # But closing and re-opening Preview and Inspector would reveal # that the "Orientation" value of the image HAS changed to # "1 (Normal)". # Once this has been done, Preview and all browsers will display # the image as it now appears. Otherwise, before they display # the image, Preview and some (but not all) browsers will rotate # it to the orientation specified by the "Orientation" value. # -W = Wait till editor exits before proceeding. # -n = New instance of the editor, even if one is already open (set echo; open -W -n $*:q)