[Digikam-devel] [Bug 152527] Digikam can't read Image Size and Bit Depth of PNGs generated by UFRAW (latest stable)

Gilles Caulier caulier.gilles at gmail.com
Mon Nov 19 07:23:06 GMT 2007


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=152527         
caulier.gilles gmail com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|general                     |Metadata



------- Additional Comments From caulier.gilles gmail com  2007-11-19 08:23 -------
Arnd,

Here, this is not the fault to Exiv2, but KDE API and especially KFileMetaInfo...

Look in the code, at digikam/libs/imageproperties/imagepropertiestab.cpp, line 468

KFileMetaInfo do not search Exif info in PNG for that. It scan whole file to find PNG Chunk witch include image informations (PNG ImageHeader Tags : http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/PNG.html#ImageHeader). 

It's completly different than the way used by Exiv2 witch do not know (yet) this chunk, but only try to find the text chunk used to embed Exif informations as a byte-array (same for IPTC and XMP). Of course i can patch Exiv2 for that...

But this is not the real problem here. Now try to parse this image with exiftool like this :

exiftool -g DSC_0006_digikam.png
======== DSC_0006_digikam.png
---- ExifTool ----
ExifTool Version Number         : 7.00
Warning                         : Bad NikonPreview directory
---- File ----
File Name                       : DSC_0006_digikam.png
Directory                       : .
File Size                       : 3 MB
File Modification Date/Time     : 2007:11:19 07:50:02
File Type                       : PNG
MIME Type                       : image/png
Exif Byte Order                 : Little-endian (Intel)
---- PNG ----
Bit Depth                       : 16
Color Type                      : RGB
Filter                          : Adaptive
Interlace                       : Noninterlaced
Significant Bits                : 16 16 16
Source                          : NIKOND80
Software                        : digiKam 0.9.2-final ( libpng version 1.2.15beta5 - December 8, 2006 (header) )
IPTC Profile                    : (Binary data 134611 bytes, use -b option to extract)
---- ICC_Profile ----
Profile CMM Type                : scrs
Profile Version                 : 2.1.0
Profile Class                   : Display Device Profile
Color Space Data                : RGB
Profile Connection Space        : XYZ
Profile Date Time               : 2001:04:12 19:02:14
Profile File Signature          : acsp
Primary Platform                : Microsoft Corporation
CMM Flags                       : Not Embedded, Independent
Device Manufacturer             : none
Device Model                    : none
Device Attributes               : Reflective, Glossy, Positive, Color
Rendering Intent                : Perceptual
Connection Space Illuminant     : 0.9642 1 0.82491
Profile Creator                 : scrs
Profile ID                      : 0
Profile Description             : Wide Gamut RGB
Profile Copyright               :
Media White Point               : 0.9642 1 0.82491
Media Black Point               : 0 0 0
Red Matrix Column               : 0.71651 0.25874 0
Green Matrix Column             : 0.10103 0.72469 0.05122
Blue Matrix Column              : 0.14679 0.0166 0.7739
Red Tone Reproduction Curve     : (Binary data 524 bytes, use -b option to extract)
Green Tone Reproduction Curve   : (Binary data 524 bytes, use -b option to extract)
Blue Tone Reproduction Curve    : (Binary data 524 bytes, use -b option to extract)
---- EXIF ----
Processing Software             : digiKam-0.9.2-final
Subfile Type                    : Full-resolution Image
Image Width                     : 684
Image Height                    : 1024
Bits Per Sample                 : 12
Compression                     : Nikon NEF Compressed
Photometric Interpretation      : Color Filter Array
Document Name                   : DSC_0006.png
Make                            : NIKON CORPORATION
Camera Model Name               : NIKON D80
Orientation                     : Horizontal (normal)
Samples Per Pixel               : 1
X Resolution                    : 300
Y Resolution                    : 300
Planar Configuration            : Chunky
Resolution Unit                 : inches
Modify Date                     : 2007:09:30 15:58:25
Reference Black White           : 0 255 0 255 0 255
CFA Repeat Pattern Dim          : 2 2
CFA Pattern 2                   : 1 2 0 1
Exposure Time                   : 1/200
F Number                        : 5.3
Exposure Program                : Program AE
ISO                             : 500
Create Date                     : 2007:09:30 15:58:25
Exposure Compensation           : 0
Max Aperture Value              : 5.1
Metering Mode                   : Center-weighted average
Flash                           : No Flash
Focal Length                    : 58.0mm
User Comment                    :
Sub Sec Time                    : 50
Sub Sec Time Original           : 50
Sub Sec Time Digitized          : 50
Exif Image Width                : 684
Exif Image Length               : 1024
File Source                     : Digital Camera
Scene Type                      : Directly photographed
Custom Rendered                 : Normal
Exposure Mode                   : Auto
Digital Zoom Ratio              : 1
Focal Length In 35mm Format     : 87mm
Scene Capture Type              : Standard
Gain Control                    : Low gain up
Contrast                        : Normal
Saturation                      : Normal
Sharpness                       : Normal
Subject Distance Range          : Unknown (0)
Date/Time Original              : 2007:09:30 15:58:25
TIFF-EP Standard ID             : 1 0 0 0
Sensing Method                  : One-chip color area
Thumbnail Offset                : 13487
Thumbnail Length                : 3584
---- MakerNotes ----
Maker Note Version              : 2.10
Color Mode                      : Color
Quality                         : Raw
White Balance                   : Auto
Focus Mode                      : AF-A
Flash Setting                   : Slow
Flash Type                      :
White Balance Fine Tune         : 0
Color Balance 1                 : 1.62109375 1.62109375 1 1
Program Shift                   : 0
Exposure Difference             : 0
Flash Exposure Compensation     : 0
ISO Setting                     : 500
Flash Exposure Bracket Value    : 0.0
Exposure Bracket Value          : 0
Crop Hi Speed                   : Off (3904x2616 cropped to 3904x2616 at pixel 0,0)
Serial Number                   : 5001393
Color Space                     : sRGB
Tone Comp                       : Auto
Lens Type                       : G
Lens                            : 18-135mm f/3.5-5.6
Flash Mode                      : Did Not Fire
AF Area Mode                    : Single Area
AF Point                        : Left
AF Points In Focus              : Left
Shooting Mode                   : Single-Frame
Auto Bracket Release            : Manual Release
NEF Curve 1                     : (Binary data 8256 bytes, use -b option to extract)
Light Source                    : Natural
Hue Adjustment                  : 0
Noise Reduction                 : Off
NEF Curve 2                     : (Binary data 1412 bytes, use -b option to extract)
Raw Image Center                : 1952 1308
Sensor Pixel Size               : 6.05 x 6.05 um
Shutter Count                   : 853
Image Optimization              : Normal
Vari Program                    :
Multi Exposure Version          : 0100
Multi Exposure Mode             : Off
Multi Exposure Shots            : 0
Multi Exposure Auto Gain        : Off
High ISO Noise Reduction        : Normal
Shot Info Version               : 0208
Vibration Reduction             : Off, Rotated 270 CW
WB RGGB Levels                  : 415 256 256 415
Lens Data Version               : 0202
Exit Pupil Position             : 102.4mm
AF Aperture                     : 5.0
Focus Position                  : 0x04
Focus Distance                  : 3.98 m
Lens ID Number                  : 143
Lens F Stops                    : 5.33
Min Focal Length                : 18.3mm
Max Focal Length                : 134.5mm
Max Aperture At Min Focal       : 3.6
Max Aperture At Max Focal       : 5.7
MCU Version                     : 145
Effective Max Aperture          : 5.2
---- Composite ----
Aperture                        : 5.3
Blue Balance                    : 1.621094
CFA Pattern                     : [Green,Blue][Red,Green]
Image Size                      : 684x1024
Lens ID                         : AF-S DX Zoom-Nikkor 18-135mm f/3.5-5.6G IF-ED
Lens                            : 18-135mm f/3.5-5.6 G
Red Balance                     : 1.621094
Scale Factor To 35mm Equivalent : 1.5
Shutter Speed                   : 1/200
Thumbnail Image                 : (Binary data 3584 bytes, use -b option to extract)
Circle Of Confusion             : 0.020 mm
Depth of Field                  : 1.00 m (3.54 - 4.54)
Focal Length                    : 58.0mm (35mm equivalent: 87.0mm)
Hyperfocal Distance             : 31.69 m
Light Value                     : 10.1
Date/Time Original              : 2007:09:30 15:58:25.50

All tags with an hexa number on starting line come from Exif/Makernotes embeded in text chunk like digiKam or Imagemagick do (i'm sure, i have talking about this subject with UFRAW author in Exiv2 mailing list)

Now look where are Dimensions, Compression, bit depth, and color mode ? Only on Exif byte array, not on PNG ImageHeader Tags...

Conclusion : i suspect than :

- this file is corrupted or uncomplete (where are dimension and compression infos ?)
- and something is wrong on KFileMetaInfo (why at least Bit Depth and Color Type are not found ?)

Gilles



More information about the Digikam-devel mailing list