bogus values for FocalLengthIn35mmFormat tag from Samsung

Started by Paul Heckbert, September 15, 2011, 08:25:47 AM

Previous topic - Next topic

Paul Heckbert

I'm writing software that reads the EXIF tags in image files, and I notice that the EXIF tag FocalLengthIn35mmFormat on images from the Samsung Digimax L85 is bad - like about 100 to 1000 times the correct value!  I'm seeing values for this tag around 30,000 to 50,000, which is absurd, since the camera's lens specifications say the focal length range (in 35mm equivalent form) is 38 - 190 mm.  The FocalLengthIn35mmFormat divided by the FocalLength should equal the crop factor for the sensor, which in the case of the L85, since it has a 1/1.8" sensor, should be about 5.  I checked other people's pictures shot with an L85, and they seem to show the same problem, for example

http://www.flickr.com/photos/bradye21/4795006159/meta/in/photostream/

shows

Focal Length     8 mm
Focal Length In35mm Format     48388 mm

The ratio of those two should be 5.  So the correct value of FocalLengthIn35mmFormat should be about 40, not 48,388.

I've never seen any other camera write bad values for this EXIF tag, other than this model of Samsung.  Have you?  But I haven't done a systematic study of other models.

Phil Harvey

Running through my sample images, I see the following anomalous values for this tag:

54200 mm        BenQ        DC E720
37337 mm        BenQ        DC E820
4293.967296 mm  Konica      KD-2
61437 mm        Logitech    Pocket Digital 130
46477 mm        Pentacon    luxmedia 7103
64438 mm        Pentacon    LM 8203
35856 mm        Samsung     Digimax A40
35856 mm        Samsung     Digimax L40
43280 mm        Samsung     Digimax L50
6062 mm         Samsung     Digimax L60
46477 mm        Samsung     Digimax L70
9920 mm         Samsung     Digimax L85
65535 mm        Samsung     Digimax V3
11113 mm        Sanyo       VPC-MZ3 Sanyo
3704 mm         Sanyo       DSC-MZ3
3704 mm         Sanyo       VPC-MZ3EX
3704 mm         Sanyo       VPC-MZ3GX
52525 mm        Trust       738AV LCD PV
21930 mm        Trust       950 PowerC@m Zoom
21930 mm        UMAX        AstraPix 590
65535 mm        UMAX        AstraSlim F4


- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Paul Heckbert

Thanks, Phil.
When that tag is missing, I can calculate focal length in 35mm equivalent if I know focal length, image width in pixels, and FocalPlaneXResolution.  I presume that's how exiftool calculates that tag when it's missing, also.

But the image width tag is missing from many image files.  I notice, on other images (not Samsung files) that exiftool sometimes knows the image width even when that information doesn't seem to be present in the EXIF information.  Normal output looks something like

$ exiftool -H IMG_3051.JPG | grep -i 'image width'
0x0004 Canon Image Width               : 3264
0x0006 AF Image Width                  : 100
0xa002 Exif Image Width                : 3264
0x1001 Related Image Width             : 3264
     - Image Width                     : 3264

Tag 0xa002 is present in this case.  Occasionally I encounter image files that lack that tag, like this:

$ exiftool -H IMG_3040.JPG | grep -i 'image width'
     - Image Width                     : 2448

Somehow exiftool is coming up with 2448, and apparently it's not from the EXIF:

$ exiftool -H IMG_3040.JPG | grep 2448
     - Image Width                     : 2448
     - Image Size                      : 2448x3264

(note lack of hex codes above, which tells me that these are all composite values).

So how does exiftool get the image width in this case?  By reading the JPEG header?

What algorithm & formula does exiftool use for focal length in 35mm equivalent?

Phil Harvey

Yes, exiftool also extracts ImageWidth from the JPEG SOF segment.

The code to calculate the scaling factor is in Image::ExifTool::Exif::CalcScaleFactor35efl if you want to see how it is done.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).