Exif metadata is not read correctly

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
User avatar
pekkaj
Posts: 5
Joined: 2011-08-16T00:57:40-07:00
Authentication code: 8675308

Exif metadata is not read correctly

Post by pekkaj »

Hi all,

This is my ImageMagick version:

> convert -version
Version: ImageMagick 6.7.1-1 2011-08-16 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
Features: OpenMP OpenCL

I have an image that has correct Orientation metadata but it is shown as 'Undefined' by ImageMagick but, for example, ExifTool, Pixelmator and Mac OS X Lion show it correctly.

Code: Select all

> identify -verbose test.jpg                                                                                                      ruby 1.8.7
Image: test.jpg
  Format: JPEG (Joint Photographic Experts Group JFIF format)
  Class: DirectClass
  Geometry: 2560x1696+0+0
  Resolution: 72x72
  Print size: 35.5556x23.5556
  Units: Undefined
  Type: TrueColor
  Endianess: Undefined
  Colorspace: RGB
  Depth: 8-bit
  Channel depth:
    red: 8-bit
    green: 8-bit
    blue: 8-bit
  Channel statistics:
    Red:
      min: 18 (0.0705882)
      max: 255 (1)
      mean: 125.86 (0.493568)
      standard deviation: 45.9383 (0.18015)
      kurtosis: 0.464146
      skewness: 0.750622
    Green:
      min: 11 (0.0431373)
      max: 255 (1)
      mean: 92.9317 (0.364438)
      standard deviation: 43.1843 (0.16935)
      kurtosis: 1.30752
      skewness: 1.23358
    Blue:
      min: 0 (0)
      max: 255 (1)
      mean: 49.0718 (0.192438)
      standard deviation: 38.4827 (0.150912)
      kurtosis: 4.90299
      skewness: 1.95329
  Image statistics:
    Overall:
      min: 0 (0)
      max: 255 (1)
      mean: 89.2878 (0.350148)
      standard deviation: 42.6463 (0.16724)
      kurtosis: 4.83892
      skewness: 1.46382
  Rendering intent: Undefined
  Interlace: None
  Background color: white
  Border color: rgb(223,223,223)
  Matte color: grey74
  Transparent color: black
  Compose: Over
  Page geometry: 2560x1696+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: JPEG
  Quality: 95
  Orientation: Undefined
  Properties:
    date:create: 2011-08-16T10:27:23+03:00
    date:modify: 2011-08-16T10:27:16+03:00
    exif:ExifImageLength: 1696
    exif:ExifImageWidth: 2560
    exif:ExifOffset: 26
    jpeg:colorspace: 2
    jpeg:sampling-factor: 2x2,1x1,1x1
    signature: d25953dc166a9ef000e83661748dad01787d91fcb61112730f20bc8189e4153a
  Profiles:
    Profile-exif: 62 bytes
  Artifacts:
    verbose: true
  Tainted: False
  Filesize: 1.104MBB
  Number pixels: 4.342MB
  Pixels per second: 33.4MB
  User time: 0.120u
  Elapsed time: 0:01.129
  Version: ImageMagick 6.7.1-1 2011-08-16 Q16 http://www.imagemagick.org
As you can see the Orientation metadata is 'undefined'.

Then I try to find it using ExifTool:

Code: Select all

ExifTool Version Number         : 8.35
File Name                       : test.jpg
Directory                       : .
File Size                       : 1079 kB
File Modification Date/Time     : 2011:08:16 10:27:16+03:00
File Permissions                : rw-r--r--
File Type                       : JPEG
MIME Type                       : image/jpeg
JFIF Version                    : 1.01
Make                            : NIKON CORPORATION
Camera Model Name               : NIKON D7000
Orientation                     : Rotate 90 CW
X Resolution                    : 300
Y Resolution                    : 300
Resolution Unit                 : inches
Software                        : Ver.1.02
Modify Date                     : 2011:08:10 17:36:57
Artist                          : 
Y Cb Cr Positioning             : Co-sited
Copyright                       : 
Exposure Time                   : 1/60
F Number                        : 2.8
Exposure Program                : Program AE
ISO                             : 1000
Sensitivity Type                : Recommended Exposure Index
Exif Version                    : 0230
Date/Time Original              : 2011:08:10 17:36:57
Create Date                     : 2011:08:10 17:36:57
Components Configuration        : Y, Cb, Cr, -
Compressed Bits Per Pixel       : 4
Exposure Compensation           : 0
Max Aperture Value              : 2.8
Metering Mode                   : Multi-segment
Light Source                    : Unknown
Flash                           : Off, Did not fire
Focal Length                    : 26.0 mm
Maker Note Version              : 2.10
Quality                         : Fine
White Balance                   : Auto1
Focus Mode                      : AF-A
Flash Setting                   : Normal
Flash Type                      : 
White Balance Fine Tune         : 0 0
WB RB Levels                    : 1.2421875 2.50390625 1 1
Program Shift                   : 0
Exposure Difference             : 0
Compression                     : JPEG (old-style)
Preview Image Start             : 12494
Preview Image Length            : 24646
Flash Exposure Compensation     : 0
ISO Setting                     : 200
Image Boundary                  : 0 0 4928 3264
External Flash Exposure Comp    : 0
Flash Exposure Bracket Value    : 0.0
Exposure Bracket Value          : 0
Crop Hi Speed                   : Off (4992x3280 cropped to 4992x3280 at pixel 0,0)
Exposure Tuning                 : 0
Serial Number                   : 6208151
VR Info Version                 : 0100
Vibration Reduction             : Off
Active D-Lighting               : Auto
Picture Control Version         : 0100
Picture Control Name            : Standard
Picture Control Base            : Standard
Picture Control Adjust          : Default Settings
Picture Control Quick Adjust    : Normal
Brightness                      : Normal
Hue Adjustment                  : None
Filter Effect                   : n/a
Toning Effect                   : n/a
Toning Saturation               : n/a
Timezone                        : +02:00
Daylight Savings                : Yes
Date Display Format             : D/M/Y
ISO Expansion                   : Off
ISO2                            : 200
ISO Expansion 2                 : Off
Auto Distortion Control         : Off
Lens Type                       : G
Lens                            : 17-50mm f/2.8
Flash Mode                      : Did Not Fire
Shooting Mode                   : Single-Frame, Auto ISO
Shot Info Version               : 0220
Firmware Version                : 1.02
Noise Reduction                 : Off
WB RGGB Levels                  : 318 641 256 247
Lens Data Version               : 0204
Exit Pupil Position             : 120.5 mm
AF Aperture                     : 2.8
Focus Position                  : 0x42
Focus Distance                  : 3.35 m
Lens ID Number                  : 0
Lens F Stops                    : 6.92
Min Focal Length                : 17.3 mm
Max Focal Length                : 50.4 mm
Max Aperture At Min Focal       : 2.8
Max Aperture At Max Focal       : 2.8
MCU Version                     : 0
Effective Max Aperture          : 2.8
Retouch History                 : None
Image Data Size                 : 9473702
Shutter Count                   : 134
Flash Info Version              : 0104
Vari Program                    : 
Multi Exposure Version          : 0100
Multi Exposure Mode             : Off
Multi Exposure Shots            : 0
Multi Exposure Auto Gain        : Off
High ISO Noise Reduction        : Normal
Power Up Time                   : 2011:08:10 17:33:24
AF Info 2 Version               : 0100
Contrast Detect AF              : Off
AF Area Mode                    : Auto-area
Phase Detect AF                 : Unknown (3)
Primary AF Point                : Unknown (2)
AF Points Used                  : Unknown (02 00 00 00 00 00 00)
Contrast Detect AF In Focus     : No
File Info Version               : 0100
Directory Number                : 100
File Number                     : 0125
AF Fine Tune                    : Off
AF Fine Tune Index              : n/a
AF Fine Tune Adj                : 0
User Comment                    : 
Sub Sec Time                    : 30
Sub Sec Time Original           : 30
Sub Sec Time Digitized          : 30
Flashpix Version                : 0100
Color Space                     : sRGB
Interoperability Index          : R98 - DCF basic file (sRGB)
Interoperability Version        : 0100
Sensing Method                  : One-chip color area
File Source                     : Digital Camera
Scene Type                      : Directly photographed
CFA Pattern                     : [Red,Green][Green,Blue]
Custom Rendered                 : Normal
Exposure Mode                   : Auto
Digital Zoom Ratio              : 1
Focal Length In 35mm Format     : 39 mm
Scene Capture Type              : Standard
Gain Control                    : High gain up
Contrast                        : Normal
Saturation                      : Normal
Sharpness                       : Normal
Subject Distance Range          : Unknown
GPS Version ID                  : 2.3.0.0
Thumbnail Offset                : 37298
Thumbnail Length                : 8213
Exif Byte Order                 : Big-endian (Motorola, MM)
Exif Image Width                : 2560
Exif Image Height               : 1696
Image Width                     : 2560
Image Height                    : 1696
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:0 (2 2)
Aperture                        : 2.8
Auto Focus                      : On
Blue Balance                    : 0.550725
Image Size                      : 2560x1696
Lens ID                         : Tamron SP AF 17-50mm f/2.8 XR Di II LD Aspherical (IF) (A16)
Lens                            : 17-50mm f/2.8 G
Preview Image                   : (Binary data 24646 bytes, use -b option to extract)
Red Balance                     : 0.70903
Scale Factor To 35 mm Equivalent: 1.5
Shutter Speed                   : 1/60
Create Date                     : 2011:08:10 17:36:57.30
Date/Time Original              : 2011:08:10 17:36:57.30
Modify Date                     : 2011:08:10 17:36:57.30
Thumbnail Image                 : (Binary data 8213 bytes, use -b option to extract)
Circle Of Confusion             : 0.020 mm
Depth Of Field                  : 2.00 m (2.63 - 4.63)
Field Of View                   : 49.2 deg (3.07 m)
Focal Length                    : 26.0 mm (35 mm equivalent: 39.0 mm)
Hyperfocal Distance             : 12.05 m
Light Value                     : 5.6
So the results are:

Code: Select all

> identify -verbose test.jpg | grep -i orientation
Orientation: Undefined

> exiftool test.jpg | grep -i orientation
Orientation                     : Rotate 90 CW
ExifTool shows it correctly.

This is a quite serious bug, since the image was produced by Google Chrome when it resizes the image before sending it to the server. I can send the image privately if you are willing to take a look at this problem.

Best Regards,
Pekka Mattila
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Exif metadata is not read correctly

Post by magick »

Send a link to your image so we can investigate / fix the problem. Thanks.
User avatar
pekkaj
Posts: 5
Joined: 2011-08-16T00:57:40-07:00
Authentication code: 8675308

Re: Exif metadata is not read correctly

Post by pekkaj »

Here is the image: http://db.tt/6kHaiGD.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Exif metadata is not read correctly

Post by magick »

We can reproduce the problem. The EXIF profile is not being read correctly. We'll have a patch to fix the problem within a day or two. Thanks.
User avatar
pekkaj
Posts: 5
Joined: 2011-08-16T00:57:40-07:00
Authentication code: 8675308

Re: Exif metadata is not read correctly

Post by pekkaj »

Thanks very much!

Keep up the good work!
User avatar
pekkaj
Posts: 5
Joined: 2011-08-16T00:57:40-07:00
Authentication code: 8675308

Re: Exif metadata is not read correctly

Post by pekkaj »

What is the status of this?

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

Re: Exif metadata is not read correctly

Post by magick »

The problem you reported is fixed in the latest release of ImageMagick.
User avatar
pekkaj
Posts: 5
Joined: 2011-08-16T00:57:40-07:00
Authentication code: 8675308

Re: Exif metadata is not read correctly

Post by pekkaj »

Great. Thank you for this. This is a very important fix for us (and hopefully for many other people who are using Chrome to scale images before sending them to the server).

Kind Regards,
Pekka
Post Reply