Project

General

Profile

lens Pentax HD 18-50 RE not in Photo.LensModel tag

Added by J M over 4 years ago

Hi,

I use a Pentax camera with the 18-50 HD RE lens.
Here are exif data issued from exiv2 -pt:
Exif.Image.NewSubfileType Long 1 Thumbnail/Preview image
Exif.Image.ImageWidth Long 1 160
Exif.Image.ImageLength Long 1 120
Exif.Image.BitsPerSample Short 3 8 8 8
Exif.Image.Compression Short 1 Non compressé
Exif.Image.PhotometricInterpretation Short 1 RGB
Exif.Image.Make Ascii 20 PENTAX
Exif.Image.Model Ascii 20 PENTAX K-01
Exif.Image.StripOffsets Long 1 104480
Exif.Image.Orientation Short 1 haut, gauche
Exif.Image.SamplesPerPixel Short 1 3
Exif.Image.RowsPerStrip Long 1 120
Exif.Image.StripByteCounts Long 1 57600
Exif.Image.XResolution Rational 1 300
Exif.Image.YResolution Rational 1 300
Exif.Image.PlanarConfiguration Short 1 1
Exif.Image.ResolutionUnit Short 1 Pouce
Exif.Image.Software Ascii 24 K-01 Ver 1.05
Exif.Image.DateTime Ascii 20 2017:03:19 18:40:34
Exif.Image.SubIFDs Long 2 103370 103776
Exif.SubImage1.NewSubfileType Long 1 Primary image
Exif.SubImage1.ImageWidth Long 1 4960
Exif.SubImage1.ImageLength Long 1 3300
Exif.SubImage1.BitsPerSample Short 1 12
Exif.SubImage1.Compression Short 1 JPEG
Exif.SubImage1.PhotometricInterpretation Short 1 Matrice de filtre de couleur
Exif.SubImage1.StripOffsets Long 1 162080
Exif.SubImage1.SamplesPerPixel Short 1 1
Exif.SubImage1.RowsPerStrip Long 1 3300
Exif.SubImage1.StripByteCounts Long 1 11009939
Exif.SubImage1.XResolution Rational 1 300
Exif.SubImage1.YResolution Rational 1 300
Exif.SubImage1.PlanarConfiguration Short 1 1
Exif.SubImage1.ResolutionUnit Short 1 Pouce
Exif.SubImage1.CFARepeatPatternDim Short 2 2 2
Exif.SubImage1.CFAPattern Byte 4 0 1 1 2
Exif.SubImage1.CFALayout Short 1 Rectangular (or square) layout
Exif.SubImage1.BlackLevelRepeatDim Short 2 2 2
Exif.SubImage1.BlackLevel Long 4 0 0 0 0
Exif.SubImage1.WhiteLevel Long 1 4078
Exif.SubImage1.DefaultScale Rational 2 1/1 1/1
Exif.SubImage1.DefaultCropOrigin Long 2 4 4
Exif.SubImage1.DefaultCropSize Long 2 4928 3264
Exif.SubImage1.BayerGreenSplit Long 1 0
Exif.SubImage1.AntiAliasStrength Rational 1 1/1
Exif.SubImage1.ActiveArea Long 4 20 8 3292 4944
Exif.SubImage2.NewSubfileType Long 1 Thumbnail/Preview image
Exif.SubImage2.ImageWidth Long 1 4928
Exif.SubImage2.ImageLength Long 1 3264
Exif.SubImage2.BitsPerSample Short 3 8 8 8
Exif.SubImage2.Compression Short 1 JPEG
Exif.SubImage2.PhotometricInterpretation Short 1 YCbCr
Exif.SubImage2.StripOffsets Long 1 11172032
Exif.SubImage2.SamplesPerPixel Short 1 3
Exif.SubImage2.RowsPerStrip Long 1 3264
Exif.SubImage2.StripByteCounts Long 1 1133824
Exif.SubImage2.XResolution Rational 1 300
Exif.SubImage2.YResolution Rational 1 300
Exif.SubImage2.PlanarConfiguration Short 1 1
Exif.SubImage2.ResolutionUnit Short 1 Pouce
Exif.SubImage2.WhitePoint Rational 2 313/1000 329/1000
Exif.SubImage2.PrimaryChromaticities Rational 6 64/100 33/100 30/100 60/100 15/100 6/100
Exif.SubImage2.YCbCrCoefficients Rational 3 299/1000 587/1000 114/1000
Exif.SubImage2.YCbCrSubSampling Short 2 2 1
Exif.SubImage2.YCbCrPositioning Short 1 Co-sited
Exif.Image.Copyright Ascii 14 Julien MOREAU
Exif.Image.ExifTag Long 1 104122
Exif.Photo.ExposureTime Rational 1 1.6 s
Exif.Photo.FNumber Rational 1 F6.3
Exif.Photo.ExposureProgram Short 1 Priorité ouverture
Exif.Photo.ISOSpeedRatings Short 1 100
Exif.Photo.DateTimeOriginal Ascii 20 2017:03:19 18:40:34
Exif.Photo.DateTimeDigitized Ascii 20 2017:03:19 18:40:34
Exif.Photo.ExposureBiasValue SRational 1 0 EV
Exif.Photo.MeteringMode Short 1 Multi-segments
Exif.Photo.Flash Short 1 Non, inhibé
Exif.Photo.FocalLength Rational 1 39.0 mm
Exif.Photo.SensingMethod Short 1 Mono-CCD
Exif.Photo.CustomRendered Short 1 Processus normal
Exif.Photo.ExposureMode Short 1 Automatique
Exif.Photo.WhiteBalance Short 1 Manuel
Exif.Photo.FocalLengthIn35mmFilm Short 1 58.0 mm
Exif.Photo.SceneCaptureType Short 1 Standard
Exif.Photo.Contrast Short 1 Dur
Exif.Photo.Saturation Short 1 Élevée
Exif.Photo.Sharpness Short 1 Dur
Exif.Photo.SubjectDistanceRange Short 1 Plan large
Exif.Image.GPSTag Long 1 104440
Exif.GPSInfo.GPSVersionID Byte 4 2.3.0.0
Exif.Image.DNGVersion Byte 4 1 1 0 0
Exif.Image.DNGBackwardVersion Byte 4 1 1 0 0
Exif.Image.UniqueCameraModel Ascii 12 PENTAX K-01
Exif.Image.ColorMatrix1 SRational 9 64609/65536 -32000/65536 -5299/65536 -22911/65536 64449/65536 28093/65536 -1175/65536 2455/65536 44907/65536
Exif.Image.ColorMatrix2 SRational 9 55672/65536 -16824/65536 -7456/65536 -26184/65536 80617/65536 12325/65536 -6455/65536 11315/65536 43018/65536
Exif.Image.AnalogBalance Rational 3 256/256 256/256 256/256
Exif.Image.AsShotNeutral Rational 3 256/593 256/256 256/351
Exif.Image.BaselineExposure SRational 1 -33194/65536
Exif.Image.BaselineNoise Rational 1 1/1
Exif.Image.BaselineSharpness Rational 1 1/1
Exif.Image.LinearResponseLimit Rational 1 1/1
Exif.Image.DNGPrivateData Byte 102400 (Valeur binaire supprimée)
Exif.MakerNote.Offset Long 1 894
Exif.MakerNote.ByteOrder Ascii 3 MM
Exif.PentaxDng.Version Byte 4 9.0.0.0
Exif.PentaxDng.Mode Short 1 Automatique
Exif.PentaxDng.PreviewResolution Short 2 640x480
Exif.PentaxDng.PreviewLength Long 1 36530
Exif.PentaxDng.PreviewOffset Long 1 32258
Exif.PentaxDng.ModelID Long 1 K-01
Exif.PentaxDng.Date Undefined 4 2017:03:19
Exif.PentaxDng.Time Undefined 3 18:40:34
Exif.PentaxDng.Quality Short 1 BRUT
Exif.PentaxDng.Flash Short 2 Off, Did not fire
Exif.PentaxDng.Focus Short 1 Manuel
Exif.PentaxDng.AFPoint Short 1 Aucun
Exif.PentaxDng.ExposureTime Long 1 1600 ms
Exif.PentaxDng.FNumber Short 1 F6.3
Exif.PentaxDng.ISO Short 1 100
Exif.PentaxDng.ExposureCompensation SShort 1 0 EV
Exif.PentaxDng.MeteringMode Short 1 Multi-segments
Exif.PentaxDng.AutoBracketing Short 2 0 EV (No extended bracketing)
Exif.PentaxDng.WhiteBalance Short 1 Nuageux
Exif.PentaxDng.FocalLength Long 1 39.0 mm
Exif.PentaxDng.Saturation Short 1 Plutôt élevé
Exif.PentaxDng.Contrast Short 1 Élevée
Exif.PentaxDng.Sharpness Short 1 Plutôt dur
Exif.PentaxDng.DSPFirmwareVersion Undefined 4 254 250 231 239
Exif.PentaxDng.EffectiveLV Short 1 4736
Exif.PentaxDng.PictureMode Byte 3 Priorité ouverture
Exif.PentaxDng.DriveMode Byte 4 Single-frame
Exif.PentaxDng.ColorSpace Short 1 sRGB
Exif.PentaxDng.ImageAreaOffset Short 2 8 20
Exif.PentaxDng.RawImageSize Short 2 4936 3272
Exif.PentaxDng.PreviewImageBorders Byte 4 28 28 0 0
Exif.PentaxDng.LensType Byte 4 HD PENTAX-DA 18-50mm F4-5.6 DC WR RE
Exif.PentaxDng.Temperature SByte 1 36 C
Exif.PentaxDng.AELock Short 1 Désactivé
Exif.PentaxDng.NoiseReduction Short 1 Désactivé
Exif.PentaxDng.FlashExposureCompensation SLong 1 -1 EV
Exif.PentaxDng.ImageTone Short 1 Bright
Exif.PentaxDng.ShakeReduction Byte 4 0 5 0 78
Exif.PentaxDng.ShutterCount Undefined 4 234 54 255 11
Exif.PentaxDng.DynamicRangeExpansion Undefined 4 Désactivé
Exif.PentaxDng.HighISONoiseReduction Byte 2 Désactivé
Exif.PentaxDng.BlackPoint Short 4 0 0 0 0
Exif.PentaxDng.WhitePoint Short 4 18976 8192 8192 11232
Exif.PentaxDng.ShotInfo Undefined 25 5 0 0 10 0 0 0 0 32 0 24 0 0 0 0 116 111 32 64 7 0 0 2 112 0
Exif.PentaxDng.AEInfo Undefined 21 77 77 62 111 32 64 0 248 64 0 2 6 0 0 0 0 104 105 144 164 2
Exif.PentaxDng.LensInfo Undefined 80 0 184 48 98 0 199 0 0 0 0 0 0 0 0 0 0 40 86 27 0 180 37 149 32 252 153 88 52 1 75 116 251 255 255 255 199 33 181 38 147 0 154 200 0 0 0 32 0 191 189 199 248 0 0 0 48 127 14 0 0 193 0 0 0 3 239 168 8 192 103 240 21 234 3 133 0 0 0 0 3
Exif.PentaxDng.FlashInfo Undefined 32 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 15 63 0 0 0 0 0 0 0 0 0 0 0 0 0
Exif.PentaxDng.CameraInfo Long 5 77560 20120505 2 1 7010437
Exif.PentaxDng.BatteryInfo Undefined 18 242 80 3 58 3 38 0 0 0 0 0 0 0 0 0 0 0 0
Exif.PentaxDng.AFInfo Undefined 20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Exif.PentaxDng.ColorInfo Undefined 18 32 131 31 100 31 125 32 156 33 72 32 246 31 51 31 10 0 0
Exif.PentaxDng.SerialNumber Ascii 20 4328339
Exif.Image.CalibrationIlluminant1 Short 1 17
Exif.Image.CalibrationIlluminant2 Short 1 21

We can see that no Exif.Photo.LensModel exist, but the information can be found in specific Pentax tag Exif.PentaxDng.LensType (and value is HD PENTAX-DA 18-50mm F4-5.6 DC WR RE).
Why is it not duplicated in Exif.Photo.LensModel tag?
Shall I ask for an issue for Exiv2?
Or if I write code based on Exiv2 to find the lens model, I need to do specific search for manufacturers special tags?

Thanks


Replies (2)

RE: lens Pentax HD 18-50 RE not in Photo.LensModel tag - Added by Robin Mills over 4 years ago

JM:

Can you attach your file to this issue please.

There are a several Exif tags involved http://www.exiv2.org/tags.html :

0xa433    42035    Photo    Exif.Photo.LensMake    Ascii    This tag records the lens manufactor as an ASCII string.
0xa434    42036    Photo    Exif.Photo.LensModel    Ascii    This tag records the lens's model name and model number as an ASCII string.
These tags have not been defined in your file.

However, the lens is defined here:

Exif.PentaxDng.LensType Byte 4 HD PENTAX-DA 18-50mm F4-5.6 DC WR RE
I cannot find documentation for PentaxDng. It's not on http://exiv2.org nor http://www.sno.phy.queensu.ca/~phil/exiftool/ The code defining those tags is stored in pentaxmn.cpp:
     const TagInfo PentaxMakerNote::tagInfo_[]

So the answer to your question: "why is it not duplicated in "Exif.Photo.LensModel?", it is because Exiv2 reports what it finds in the file and does not manufacture data.

If the tags Exif.Photo.LensMake and Exif.Photo.LensModel are important to your work flow, you can easily write a bash script to create this data in your images in your library.

It would be possible to add a function to pentaxmn.cpp (or more likely to tiffimage.cpp) to create "Exif.Photo.LensModel" and add it to the metadata. This code doesn't exist because I don't believe this has ever been discussed! Exif.PentaxDng.LensType is stored in Exif.Photo.MakerNote which is TIFF formatted data. The class TiffVisitor parses embedded TIFF data. You should discover the function that is called by TiffVisitor when PentaxDng.LensType is encountered. At that moment, you should create Exif.Photo.LensModel and you're done. Please note that Exif.PentaxDng.LensType is a 4 byte integer and tags Exif.Photo.LensModel and Exif.Photo.LensType are strings.

If you'd like to submit a patch for this, I'll be happy to review and submit. We're in the final steps of releasing Exiv2 v0.26, so this feature won't appear until v0.27. If you need assistance/mentoring with the patch, I'll be happy to help you once v0.26 has been released. However, I hope you'll prefer (and accept) my explanation that Exiv2 doesn't manufacture data.

RE: lens Pentax HD 18-50 RE not in Photo.LensModel tag - Added by J M over 4 years ago

Thanks for explanations.
I accept that Exiv2 does not create data, it reports what it finds.

I added the original file in the case it may be useful for anybody.

    (1-2/2)