Image-ExifTool - Re: Detecting Orientation

Posted on Mon Aug 25 13:42:04 2008 by exiftool in response to 8664 (See the whole thread of 6)
Re: Detecting Orientation
The 180 degree image was left as-is because the Orientation was set to "Normal".

The script needs to check for null values. Maybe something like this...

... my $rotation = $exifTool->GetValue('Orientation', 'ValueConv'); unless (defined $rotation and defined $rot_args{$rotation}) { print "Nothing to do\n"; exit 0; } my $command = "jpegtran -copy all $rot_args{$rotation} IMG_7885.JPG > IMG_7885_2.JPG"; ...

You don't rotation an image if the Orientation is "Normal", so you should do nothing if the value is 1. If your camera uses this value when the image is rotated by 180 degrees, it is because the camera doesn't know when it is upside down.

- Phil
Direct Responses: 8672 | Write a response