Feature #1323

Add lens "Sigma 18-300mm f/3.5-6.3 DC Macro OS HS" for Canon ID 197

Added by Ronny Heidenreich 11 days ago. Updated 9 days ago.

Status:ClosedStart date:11 Nov 2017
Priority:NormalDue date:
Assignee:Robin Mills% Done:

100%

Category:lensEstimated time:1.00 hour
Target version:v0.26.1

Description

$ exiv2 -pt IMG_6312.cr2 | grep -ai lens
Exif.CanonCs.LensType Short 1 Canon EF 75-300mm f/4-5.6 IS USM
Exif.CanonCs.Lens Short 3 18.0 - 300.0 mm
Exif.Canon.LensModel Ascii 70 18-300mm
Exif.Photo.LensSpecification Rational 4 18/1 300/1 0/0 0/0
Exif.Photo.LensModel Ascii 70 18-300mm
Exif.Photo.LensSerialNumber Ascii 12 0000000000

https://www.sigma-global.com/en/lenses/cas/product/contemporary/c_18_300_35_63/

IMG_6559.JPG (2.66 MB) Ronny Heidenreich, 12 Nov 2017 10:14

History

#1 Updated by Robin Mills 11 days ago

  • Category set to lens
  • Status changed from New to Assigned
  • Assignee set to Robin Mills
  • Target version set to v0.26.1
  • % Done changed from 0 to 10
  • Estimated time set to 2.00

Can you attach an image taken with this lens and I will investigate.

#2 Updated by Ronny Heidenreich 10 days ago

#3 Updated by Robin Mills 10 days ago

  • % Done changed from 10 to 50

Thanks for the test file. The quick fix for this in Exiv2 v0.26 is to add the following to ~/.exiv2:

[canon]
197=Sigma 18-300mm f/3.5-6.3 DC Macro OS HS

Lens recognition is not simple because manufacturers often use the same lens id (in this case 197) for more than one lens. You could modify the code in src/canonmn.cpp to be:

        { 197, "Sigma 18-300mm f/3.5-6.3 DC Macro OS HS"                    },

However in order to permanently add the recognition of your lens, we have to provide a function such as:

        { 197, printCsLensByFocalLength }, // not tested
The function printCsLensByFocalLength has to be "tuned" to examine all the metadata in the image to distinguish your lens from another with ID = 197.

I added the file ~/.exiv2 for the following reasons:
1) You can overwrite the "built in" definition without waiting for a new release of Exiv2
2) to save me the effort to add code to determine which of several lens is in use
3) When you update your version of Exiv2, your definition in ~/.exiv2 remains valid.

Here's the documentation for this feature: http://dev.exiv2.org/projects/exiv2/wiki/Lens_Recognition_in_Exiv2_v026_(and_later)

#4 Updated by Robin Mills 9 days ago

  • Status changed from Assigned to Closed
  • % Done changed from 50 to 100
  • Estimated time changed from 2.00 to 1.00

I'm going to close this issue. If you wish to discuss this further, you are welcome to add comments and I will reopen the case.

If you'd like to accept the challenge of updating the code in printCsLensByFocalLength to identify your lens, I'm always looking for volunteers to join Team Exiv2. You'll find this interesting, rewarding and a little frustrating. I assure you of great mentoring and encouragement from other team members.

Also available in: Atom PDF

Redmine Appliance - Powered by TurnKey Linux