Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tamron SP 15-30mm F/2.8 Di VC USD G2 A041 is showing up with the Exif.CanonCs.LensType from another lens (35-150) #3062

Open
eldoradobirds opened this issue Oct 30, 2024 · 8 comments · May be fixed by #3063
Labels
lens Issue related to lens detection request feature request or any other kind of wish

Comments

@eldoradobirds
Copy link

eldoradobirds commented Oct 30, 2024

When I look at the exif in a Windows Photo Processing Tool like Canon DPP I just see the lens identified as the Tamron SP 15-30mm ... which is correct. When I use the exiv2 command below in linux I see the Exif.CanonCs.LensType field as another lens which then (wrongly) shows up in Darktable (linux) lens correction window. Note that the Exif.PhotoLensModel and Exif.Canon.LensModel fields match the lens.

$ exiv2 -pt 9M6A3718.CR3 | grep -i 'lens|model|make'
Exif.Image.Make Ascii 6 Canon
Exif.Image.Model Ascii 13 Canon EOS R5
Exif.Photo.LensSpecification Rational 4 15/1 30/1 0/1 0/1
Exif.Photo.LensModel Ascii 42 TAMRON SP 15-30mm F/2.8 Di VC USD G2 A041
Exif.Photo.LensSerialNumber Ascii 11 0000000000
Exif.CanonCs.LensType Short 1 Tamron 35-150mm f/2.8-4.0 Di VC OSD
Exif.CanonCs.Lens Short 3 15.0 - 30.0 mm
Exif.Canon.ModelID Long 1 EOS R5
Exif.CanonFi.RFLensType SShort 1 n/a
Exif.Canon.LensModel Ascii 138 TAMRON SP 15-30mm F/2.8 Di VC USD G2 A041

Note sure what is wrong here.

@kmilos
Copy link
Collaborator

kmilos commented Oct 31, 2024

Which exiv2 version? Please try w/ latest 0.28.3, there have been some recent fixes specifically around detection for Canons...

Note that the Exif.PhotoLensModel and Exif.Canon.LensModel fields match the lens.

darktable (for whatever legacy reasons) uses only Exif.CanonCs.LensType for Canon SLR (i.e. non RF) lenses.

@kmilos
Copy link
Collaborator

kmilos commented Oct 31, 2024

Also, it looks like neither exiv2 nor exiftool have this specific G2 lens in their databases (only the older A012 version), so please feel free to contribute a PR.

In the meantime, you can use the exiv2 config file workaround.

Edit: found some samples.

@kmilos kmilos added request feature request or any other kind of wish lens Issue related to lens detection and removed bug labels Oct 31, 2024
@kmilos kmilos linked a pull request Oct 31, 2024 that will close this issue
@eldoradobirds
Copy link
Author

Thanks for the info about Darktable only using the LensType. I tried to use exiv2 to modfiy but get this:

$ exiv2 -m cmd.txt 9M6A3718.CR3
Warning: Exif.CanonCs.LensType: Failed to read Short value "TAMRON SP 15-30mm F/2.8 Di VC USD G2"
Exiv2 exception in modify action for file 9M6A3718.CR3:
Setting Image comment in BMFF images is not supported

$ more cmd.txt
set Exif.CanonCs.LensType Short TAMRON SP 15-30mm F/2.8 Di VC USD G2

Not sure what BMFF means but it seems like this field can't be modified?

@eldoradobirds
Copy link
Author

Also tried adding an .exiv2 file but it did not seem to work.

$ more .exiv2
[canon]
Tamron 35-150mm f/2.8-4.0 Di VC OSD=TAMRON SP 15-30mm F/2.8 Di VC USD G2

$ exiv2 --print t --grep lens/i 9M6A3718.CR3
Exif.Photo.LensSpecification Rational 4 15/1 30/1 0/1 0/1
Exif.Photo.LensModel Ascii 42 TAMRON SP 15-30mm F/2.8 Di VC USD G2 A041
Exif.Photo.LensSerialNumber Ascii 11 0000000000
Exif.CanonCs.LensType Short 1 Tamron 35-150mm f/2.8-4.0 Di VC OSD
Exif.CanonCs.Lens Short 3 15.0 - 30.0 mm
Exif.CanonFi.RFLensType SShort 1 n/a
Exif.Canon.LensModel Ascii 138 TAMRON SP 15-30mm F/2.8 Di VC USD G2 A041

@kmilos
Copy link
Collaborator

kmilos commented Oct 31, 2024

I tried to use exiv2 to modfiy

I never mentioned the exiv2 -m modify command... It might not be a good idea to ever tamper with your raw files...

$ more .exiv2
[canon]
Tamron 35-150mm f/2.8-4.0 Di VC OSD=TAMRON SP 15-30mm F/2.8 Di VC USD G2

Of course this doesn't work, you need an ID number to string mapping...

@kmilos
Copy link
Collaborator

kmilos commented Oct 31, 2024

So:

[canon]
117=Tamron SP 15-30mm f/2.8 Di VC USD G2

@eldoradobirds
Copy link
Author

Thanks. I see it showing the correct info now in the exiv2 command and in Darktable.

$ exiv2 -pt 9M6A3718.CR3 | grep -i 'lens|model|make'
Exif.Image.Make Ascii 6 Canon
Exif.Image.Model Ascii 13 Canon EOS R5
Exif.Photo.LensSpecification Rational 4 15/1 30/1 0/1 0/1
Exif.Photo.LensModel Ascii 42 TAMRON SP 15-30mm F/2.8 Di VC USD G2 A041
Exif.Photo.LensSerialNumber Ascii 11 0000000000
Exif.CanonCs.LensType Short 1 TAMRON SP 15-30mm F/2.8 Di VC USD G2
Exif.CanonCs.Lens Short 3 15.0 - 30.0 mm
Exif.Canon.ModelID Long 1 EOS R5
Exif.CanonFi.RFLensType SShort 1 n/a
Exif.Canon.LensModel Ascii 138 TAMRON SP 15-30mm F/2.8 Di VC USD G2 A041

Is there some way to query to get the ID number for a lens in general?

Also, this lens is an EF mount lens so the lens correction module in Darktable only seems to let me pick a Canon camera that is EF mount. However, Canon RF mount cameras can use the EF to RF adapter. Maybe this is some issue with the lensfun database?

@kmilos
Copy link
Collaborator

kmilos commented Oct 31, 2024

Is there some way to query to get the ID number for a lens in general?

It was in the config file instructions: use -pv instead of -pt

Maybe this is some issue with the lensfun database?

Quite possible indeed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lens Issue related to lens detection request feature request or any other kind of wish
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants