Sigma 8-16mm f4,5-5,6 DC HSM pour Pentax

Started by gwinru, December 13, 2010, 12:13:35 PM

Previous topic - Next topic

gwinru

Hi,

I am discovering exiftool and I try to undestand. (apologize for my english, I am french).
I have a Sigma 8-16mm F4.5-5.6 DC HSM on a Pentax K7.
I have two problems :
- The name of the lens is not reported. In Exiftool I have Lens Type : Unknow (8 18)
- The focal lengh under 10 mm is not reported by the Pentax body, the indication is ---mm . In Exiftool I found for exemple FocalLength=8.1mm.
For focal lengh I used ExifTool Gui and I edit the Exif to introduce the focal lengh value. It work correctly in Lightroom and I can apply lens corrections

Is there a solution for the name ?

Phil Harvey

#1
Thanks for reporting this new Pentax LensType value:

    '8 18' = Sigma 8-16mm F4.5-5.6 DC HSM

I will add this to the list, and ExifTool 8.43 (when released) should properly report this lens.

- Phil

Edit:  I just took a look at the specs for this lens.  Nice.  I didn't know you could get a rectilinear lens this wide.  I really like my Sigma 10-20mm on the K-5, but this lens goes even wider!  :)
...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 ($).

gwinru

Great thanks !
Any idea for focal lenght ? Any other solution ?
I send mail to Pentax, they said that it is not their responsability, it is the responsability of Sigma.
Same response from Sigma.

Other question : what's about database of Lightroom ? Did they use your database ?

Phil Harvey

Quote from: gwinru on December 13, 2010, 01:07:26 PM
Any idea for focal lenght ? Any other solution ?

If Pentax:FocalLength is correct, but EXIF:FocalLength is missing, you can use exiftool to fill in the EXIF:FocalLength:

exiftool -if 'not $exif:focallength' '-focallength<pentax:focallength' DIR

where DIR is the name of a directory containing the images.  Note: On Windows, use double quotes instead of single quotes around the arguments.

Quote
I send mail to Pentax, they said that it is not their responsability, it is the responsability of Sigma.
Same response from Sigma.

Typical.  I don't think this is something that Sigma could fix.  Pentax has no motivation to support Sigma lenses, but they would have to fix this if the ever came out with an 8mm lens.

Quote
Other question : what's about database of Lightroom ? Did they use your database ?

I don't know if Adobe is using my lens database, but it wouldn't surprise me if they do.  However, their update time is a bit slower than mine.

- 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 ($).

gwinru

Concerning focal length, to be exact the EXIF is not empty, it show :
FocalLength : 0.0 mm
I think I had to modify your code for remplacing value, could you help me ?

Phil Harvey

You could try something like this:

exiftool -if '$exif:focallength# < 8' ...

Again, use double quotes in Windows.  The # extracts the numerical value for the tag so we can test it with the numerical less-than operator (<).

- 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 ($).

gwinru

Hi Harvey,

Don't work.
The problem seem to be there is two value Pentax:focallength
The response at the command :
exiftool -a -Pentax:focallength XXXXX.PEF
Focallength : 0.0 mm
Focallength : 8.1 mm

How can I use the good tag ?

JP

PS : the Sigma 8-16 is a fabulous lens. Image is rectilinear and Lightroom has corrections. It's a new lens for me and I hope greats images with it.
PS2 : Does the K5 have the same problem with focallength under 10mm ?

Phil Harvey

Hi JP,

Use the -G4 option to figure out which copy of FocalLength you want to use, then specify this tag in your command:

> exiftool ../pics/PentaxK-7.jpg -focallength -G4:1
[ExifIFD]       Focal Length                    : 24.0 mm
[Copy1:Pentax]  Focal Length                    : 24.0 mm
[Copy2:Pentax]  Focal Length                    : 23.8 mm

> exiftool ../pics/PentaxK-7.jpg -if '$copy2:focallength < 8' ...


I don't know if the K-5 has problems with focal lengths less than 10mm because the 10-20mm  is my widest lens.

- 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 ($).

gwinru


spyderweber

Hi Harvey,

I recently purchased the Sigma 8-16 along with the Pentax K-5 and found myself unable to correct the lens distortion in Lightroom 3 for anything under 10 mm focal length, which brought me to this forum (and many others).  The issue is well documented, and everyone has gotten so close to figuring it out without actually posting any efficient work-arounds (that I have found).  I think I've got it, with the help of your excellent ExifTool!  But before I post it on other forums, I am hoping you can help me make it as elegant and efficient as possible.  It turns out that Lightroom not only needs to be able to read the focal length, it also needs the 35 mm equivalent focal length.  The lens correction only works when Lightroom can read both.  So I have come up with a two step process (building on others work).  (I am running OS X 10.6.8 and using Automator, so I've left out the directories.)

1. Fill appropriate Focal Length field: exiftool '-focallength<$copy2:focallength' -if '$focallength# == 0.0' "$f"
2. Manually calculate 35mm equivalent based on specific focal lengths and fill that field: exiftool -if '$focallength# == 8.1' -overwrite_original -FocalLengthIn35mmFormat='12.2' "$f"

I am not a programmer and have tried in vain to create a one step process where I can also fill the 35mm equivalent field based on the focal length and 1.5x sensor to 35mm factor.  Is there a way to make this a one step process?

Thank you,
Christopher Weber

Phil Harvey

#10
Hi Christopher,

I think I can do what you want with 2 commands:

exiftool -focallengthin35mmformat= -focalplanexresolution=5206 -focalplaneyresolution=5206 -focalplaneresolutionunit=inches '-focallength<$copy2:focallength' -if '$focallength# == 0' FILE

exiftool '-focallengthin35mmformat<focallength35efl#' -if 'not $focallengthin35mmformat' FILE


This takes advantage of the FocalLength35efl tag that Exiftool calculates from the other tags set in the first command.  I don't know what the exact sensor resolution is, but I've used 5206 because it gives me the 1.5 crop factor that I want (for full-sized K-5 images that is).

Be sure to mention that they must use double quotes instead of single quotes in the commands if run in Windows.

- Phil

Edit:  These commands are a big lengthy, so using an argument file may make things easier:

exiftool -@ fixfocal.args -common_args FILE

with this "fixfocal.args" file:

-focallengthin35mmformat=
-focalplanexresolution=5206
-focalplaneyresolution=5206
-focalplaneresolutionunit=inches
-focallength<$copy2:focallength
-if
$focallength# == 0
-execute
-focallengthin35mmformat<focallength35efl#
-if
not $focallengthin35mmformat
...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 ($).

spyderweber

Hi Phil, (I apologize for addressing you by your last name yesterday  :-[ )

Thanks for responding so quickly.  I was finally able to test it out and got your 2 commands to work beautifully!  That definitely saves time from my manual 35mm format calculations. 

The sensor size is actually 4992 and cropped to 4928 for the RAW file on the K-5.  I know the actual crop factor is not exactly 1.5, but that is the standard everyone uses and probably the basis for how the Lightroom lens correction profiles were determined, so I will stick with your 5206. 

I am still trying to get the argument file to work, but I need to work on some other things right now, so I will have to come back to it.  I just wanted to get back and say thank you for helping out with this.  Hopefully, we will make some fellow Pentaxians happy with this solution!

Cheers,
Christopher

Phil Harvey

Hi Christopher,  (no need to apologize)

After my last post I noticed that the Pentax cameras write SensorSize information.  From this I can calculate the scaling factor much more directly (from this one tag, instead of requiring 5 tags: FocalPlaneXResolution, FocalPlaneYResolution, FocalPlaneResolutionUnit, ImageWidth and ImageHeight).

So just for fun I will incorporate SensorSize into the scaling factor calculation of ExifTool 8.73 (to be released tomorrow).  With this new version, the first command will be much simpler:

exiftool -focallengthin35mmformat= '-focallength<$copy2:focallength' -if '$focallength# == 0' FILE

exiftool '-focallengthin35mmformat<focallength35efl#' -if 'not $focallengthin35mmformat' FILE


But note that this will not work for ExifTool 8.72 or earlier.

I think the SensorSize may actually include some black border pixels, but it gives a scaling factor of 1.49542, which is pretty close.

- 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 ($).

killes

Quote from: Phil Harvey on December 16, 2011, 01:14:17 PM

exiftool -focallengthin35mmformat= '-focallength<$copy2:focallength' -if '$focallength# == 0' FILE

exiftool '-focallengthin35mmformat<focallength35efl#' -if 'not $focallengthin35mmformat' FILE


But note that this will not work for ExifTool 8.72 or earlier.


I've tried this with 8.74 and there seems to be an error in the calculation.


From an image shot with a pentax lens I get:


exiftool /mnt/karte/DCIM/108_2612/IMGP4905.JPG -G4:1| grep oca
[ExifIFD]       Focal Length                    : 35.0 mm
[ExifIFD]       Focal Length In 35mm Format     : 52 mm
[Pentax]        World Time Location             : Hometown
[Pentax]        SR Focal Length                 : 35 mm
[Composite]     Focal Length                    : 35.0 mm (35 mm equivalent: 52.0 mm)

From an image shot with the Sigma  4.5mm and corrected as above I get:

xiftool /tmp/IMGP4921.JPG -G4:1| grep oca
[ExifIFD]       Focal Length                    : 5.0 mm
[ExifIFD]       Focal Length In 35mm Format     : 5 mm
[Pentax]        World Time Location             : Hometown
[Pentax]        SR Focal Length                 : 10 mm
[Composite]     Focal Length                    : 5.0 mm (35 mm equivalent: 5.0 mm)
[Composite]     Hyperfocal Distance             : 0.15 m

The 35mm value should be 7.5mm not 5mm, I think.

This is a on a Pentax K10D which has an APS-C sensor. Bug or user error?

Cheers,
Gerhard


Phil Harvey

Hi Gerhard,

Was the EXIF:FocalLength equal to 0 before you processed the file?  After the 1st command, what were the values of all tags that contribute to the scale factor calculation?:

FocalLength
FocalLengthIn35mmFormat
Composite:DigitalZoom
FocalPlaneDiagonal
SensorSize
FocalPlaneXSize
FocalPlaneYSize
FocalPlaneResolutionUnit
FocalPlaneXResolution
FocalPlaneYResolution
ExifImageWidth
ExifImageHeight
CanonImageWidth
CanonImageHeight
ImageWidth
ImageHeight

- 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 ($).