Project

General

Profile

Bug #11753

Wrong focal length and focal distance from Canon .CRW raw files

Added by Ed Svoboda 10 months ago. Updated about 1 month ago.

Status:
New
Priority:
Low
Assignee:
-
Category:
General
Target version:
-
Start date:
09/29/2017
Due date:
% Done:

0%

Affected Version:
git master branch
System:
Ubuntu
bitness:
64-bit
hardware architecture:
amd64/x86

Description

Focal length and focal distance information from Canon .CRW raw files is incorrect.

In the attached .CRW file from my Canon PowerShot G5, darktable's image information gives me the following incorrect values:

focal length: 406 mm
focus distance: 45.00 m

These incorrect values are also used by the lens correction module.

exiftool 10.10, on the other hand, gives me the following correct values:

Focal length: 12.6875 mm
Focal Distance Upper: 0.45 m

This problem occurs with all .CRW raw files that I have tried from my camera as well as all other .CRW raw files that I have tried from other models on the Internet. This seems to be a general issue with .CRW files and not specific to the PowerShot G5.

20170927_0075.CRW (5.39 MB) Ed Svoboda, 09/29/2017 06:46 AM

History

#1 Updated by Ed Svoboda 10 months ago

^ "focal distance" should be "focus distance"

#2 Updated by Roman Lebedev 10 months ago

  • Status changed from New to Closed: upstream

I'm pretty sure the bug is in exiv2, since we simply use whatever it provides, and i guess for that format it provides incorrectly-scaled values


$ EXIV2 20170927_0075.CRW | grep -i dist
0x0013 Exif.CanonSi.SubjectDistance Short 1 2 45 45
20170927_0075.CRW: (No XMP data found in the file)
$ exiv2 pr 20170927_0075.CRW | grep dist
Subject distance: 45 <- units, anyone?
$ exiftool 20170927_0075.CRW | grep -i dist
Focus Distance Upper : 0.45 m
Focus Distance Lower : 0 m
Hyperfocal Distance : 9.12 m

So please try exiv2 git master, and if it still happens, report to http://dev.exiv2.org/

#3 Updated by Roman Lebedev 9 months ago

  • Target version set to 2.4.0

#4 Updated by Ed Svoboda about 1 month ago

Not sure why I never replied. I'm still seeing the problem. With the test file above and exiv2 0.25, here's what I get:

ed@haight:~/Downloads$ exiv2 20170927_0075.CRW
File name : 20170927_0075.CRW
File size : 5653012 Bytes
MIME type : image/x-canon-crw
Image size : 2592 x 1944
Camera make : Canon
Camera model : Canon PowerShot G5
Image timestamp : 2017:09:27 15:24:02
Image number : 102-0234
Exposure time : 1/76 s
Aperture : F2.8
Exposure bias :
Flash :
Flash bias : 0 EV
Focal length : 12.7 mm
Subject distance: 0.45 m
ISO speed : 50
Exposure mode : Aperture priority (Av)
Metering mode :
Macro mode : Off
Image quality : RAW
Exif Resolution : 2592 x 1944
White balance : Cloudy
Thumbnail : image/jpeg, 5624 Bytes
Copyright :
Exif comment :

I pulled down a bunch of CRW files from raw.pixls.us and they all give wacky too-high values for focal length and focus distance in darktable yet when checked with exiv2, they give correct values.

Other raw formats such as DNG do not give me a problem. Darktable gives correct values on my machine that match exiv2.

CRW is an old Canon raw format. The problem continues in darktable 2.4.4.

#5 Updated by Roman Lebedev about 1 month ago

  • Affected Version changed from 2.2.5 to git master branch
  • Status changed from Closed: upstream to New
  • Target version deleted (2.4.0)

Ed Svoboda wrote:

Not sure why I never replied. I'm still seeing the problem. With the test file above and exiv2 0.25, here's what I get:

ed@haight:~/Downloads$ exiv2 20170927_0075.CRW
File name : 20170927_0075.CRW
File size : 5653012 Bytes
MIME type : image/x-canon-crw
Image size : 2592 x 1944
Camera make : Canon
Camera model : Canon PowerShot G5
Image timestamp : 2017:09:27 15:24:02
Image number : 102-0234
Exposure time : 1/76 s
Aperture : F2.8
Exposure bias :
Flash :
Flash bias : 0 EV

Focal length : 12.7 mm
Subject distance: 0.45 m

Hmm, now that i re-check, dt is wrong about focal length though.

ISO speed : 50
Exposure mode : Aperture priority (Av)
Metering mode :
Macro mode : Off
Image quality : RAW
Exif Resolution : 2592 x 1944
White balance : Cloudy
Thumbnail : image/jpeg, 5624 Bytes
Copyright :
Exif comment :

I pulled down a bunch of CRW files from raw.pixls.us and they all give wacky too-high values for focal length and focus distance in darktable yet when checked with exiv2, they give correct values.

Other raw formats such as DNG do not give me a problem. Darktable gives correct values on my machine that match exiv2.

CRW is an old Canon raw format. The problem continues in darktable 2.4.4.

Also available in: Atom PDF