EXIF orientation bug

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
peugas

EXIF orientation bug

Post by peugas »

The last available binary version 6.3.1 doesnt recognise
canon orientation EXIF, so i cannot use auto-orient or
even orient options:

EXAMPLE
- with jhead:
Exif header 10238 bytes long
Exif section in Intel order
(dir has 9 entries)
Make = "Canon"
Model = "Canon PowerShot S80"
Orientation = 6
XResolution = 180/1
YResolution = 180/1
ResolutionUnit = 2
DateTime = "2006:10:24 12:04:45"
YCbCrPositioning = 1
ExifOffset = 196
Exif Dir:(dir has 31 entries)

- with identify:
Image: IMG.JPG
Format: JPEG (Joint Photographic Experts Group JFIF
format)
Class: DirectClass
Geometry: 2048x1536+0+0
Type: TrueColor
Endianess: Undefined
Colorspace: RGB
Channel depth:
Red: 8-bit
Green: 8-bit
Blue: 8-bit
Channel statistics:
Red:
Min: 0 (0)
Max: 255 (1)
Mean: 145.717 (0.571439)
Standard deviation: 57.58 (0.225804)
Green:
Min: 0 (0)
Max: 255 (1)
Mean: 120.918 (0.474189)
Standard deviation: 66.9021 (0.262361)
Blue:
Min: 0 (0)
Max: 255 (1)
Mean: 104.197 (0.408615)
Standard deviation: 72.6315 (0.28483)
Colors: 208657
Rendering intent: Undefined
Resolution: 72x72
Units: Undefined
Filesize: 905.398kb
Interlace: None
Background color: white
Border color: rgb(223,223,223)
Matte color: grey74
Transparent color: black
Page geometry: 2048x1536+0+0
Dispose: Undefined
Iterations: 0
Compression: JPEG
Quality: 90
Orientation: Undefined
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

Post a URL to your image so we can download it, reproduce the problem, and investigate further.
peugas

Post by peugas »

hi
i have uploaded one of my photos

Your Download-Link:exif_oriented.jpg

http://www.i-file.org/?d=263A34D91

please check it

regards
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

Which ImageMagick binary are you using. We tried your image with the latest ImageMagick release, 6.3.1-7 and got this:
  • -> identify -verbose exif_oriented.jpg
    Image: exif_oriented.jpg
    Format: JPEG (Joint Photographic Experts Group JFIF format)
    Class: DirectClass
    Geometry: 2048x1536+0+0
    Type: TrueColor
    Endianess: Undefined
    Colorspace: RGB
    Channel depth:
    ...
    Signature: 7d9d4ead398ae83a63b15a93eaae60c7483d7963af5fda8413b72701ec021a56
    Profile-exif: 9724 bytes
    0x00000000: 78696600 0049492a 00080000 0009000f 01020006 Exif--II*-----------
    ...
    Make: Canon
    Model: Canon PowerShot S80
    Orientation: 0
    X Resolution: 72/1
    Y Resolution: 72/1
    Resolution Unit: 1
    Date Time: 2006:10:23 11:04:40
    Y Cb Cr Positioning: 1
    Exif Offset: 196
    Exposure Time: 1/60
    F Number: 40/10
    Exif Version: 0220
    Date Time Original: 2006:10:23 11:04:40
    Date Time Digitized: 2006:10:23 11:04:40
    Components Configuration: ...
    Compressed Bits Per Pixel: 3/1
    Shutter Speed Value: 189/32
    Aperture Value: 128/32
    Exposure Bias Value: 0/3
    Max Aperture Value: 95/32
    Metering Mode: 5
    Flash: 16
    Focal Length: 5800/1000
    Maker Note: .
    User Comment:
    Flash Pix Version: 0100
    Color Space: 1
    Exif Image Width: 2048
    Exif Image Length: 1536
    Interoperability Offset: 2206
    Interoperability Index: R98
    Interoperability Version: 0100
    Related Image Length: 2048
    Related Image Width: 1536
    Focal PlaneX Resolution: 2048000/286
    Focal PlaneY Resolution: 1536000/214
    Focal Plane Resolution Unit: 2
    Sensing Method: 2
    File Source: .
    Custom Rendered: 0
    Exposure Mode: 0
    White Balance: 0
    Digital Zoom Ratio: 3264/3264
    Scene Capture Type: 0
    Profile-icm: 3144 bytes
    ...
peugas

Post by peugas »

But have you tried auto orient to correct the right orientation of the image?

I am using the latest window binary, and i have tried with different images (orientation) and it cannot be detected! the orientation is always zero (irfanview and others correctly detect the orientation

for the same image:
Make: Canon
Model: Canon PowerShot S80
Orientation: 0

that should be (with jhead / www.sentex.net/~mwandel/jhead)
Make = "Canon"
Model = "Canon PowerShot S80"
Orientation = 1
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

Post a URL to one or two images where you think ImageMagick is not properly reading the orientation parameter. Let us know what ImageMagick reports and what you think it should be. We'll try to reproduce the problem and come up with a fix.
peugas

Post by peugas »

The two small files cannot be resized with mogrify or they loose the orientation exif information (must be rotated 90º clockwise)

PS:convert and mogrify cannot read the orientation exif tag properly

Original:
http://www.i-file.org/?d=95A1D5C11
http://www.i-file.org/?d=1B216B3F1

After rotation with irfanview (automatically)
small_1_rotated.jpg
http://www.i-file.org/?d=33C1EB2F1
small_2_rotated.jpg
http://www.i-file.org/?d=4A46AA8A1

Thanks for your help
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

Try ImageMagick 6.3.2-1. It reports the correct EXIF orientation.
peugas

Post by peugas »

:D ok now it is working correctly
another bug crushed
Post Reply