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

lensName does not return name of lens #2779

Closed
DougRogers opened this issue Sep 22, 2023 · 18 comments
Closed

lensName does not return name of lens #2779

DougRogers opened this issue Sep 22, 2023 · 18 comments
Labels
bug lens Issue related to lens detection

Comments

@DougRogers
Copy link

In easyaccess, calling lensName can return an ID, not the actual lens name. The correct lens name should be returned in this function.

@DougRogers DougRogers added the bug label Sep 22, 2023
@norbertwg
Copy link
Contributor

The intention is to return the lens name, which is easy, when lens name is stored as Ascci like in Exif.Canon.LensModel. But many cameras just write an ID, which then needs to be mapped to the name. So when an ID is shown, this means, that the mapping is not yet done. When you provide a link to a sample picture and the name of the lens, I can add this mapping.

As mentioned in #2751 and #2750 you can also add the lens ID in your local configuration - as a workaround until a new release with this mapping is available.

@DougRogers
Copy link
Author

"But many cameras just write an ID, which then needs to be mapped to the name"

That is what I would like this function to do, I am writing an app that loads images and displays the EXIF data. I would like a single function I can use to obtain the name of the lens used to capture the image.

@norbertwg
Copy link
Contributor

Using easyaccess is the correct way to achieve this goal, because it checks several tags (e.g. from Nikon or Canon). When we get aware of a missing lens and get the needed information, we add this lens in mapping. But as there are always new lenses, we will always have the risk, that a lens is not recognized.

Do you have a concrete example? Then I can take care to add the lens.

In #2750 I started a discussion, if a slight change in logic of easyaccess could give some improvements. Also in respect to this aspect, it might help, if I can get more details, e.g. the output of exiv2 -pt <filename< | grep -i lens

@DougRogers
Copy link
Author

Here are two.

IMG_0668
IMG_0671

@DougRogers
Copy link
Author

DougRogers commented Sep 26, 2023

lensName returns 164
https://www.dropbox.com/scl/fi/bo47y0q3gba4zmihm3xfy/_NIK2285.NEF?rlkey=cwgpzgxgehjyxccnt3ldpi4js&dl=0

Photoshop lists lens as 70-200mm

@DougRogers
Copy link
Author

DougRogers commented Sep 26, 2023

lensName returns 129
https://www.dropbox.com/scl/fi/osmaxh00km9fcl5jdptys/_NIK2691.NEF?rlkey=zmbohmak8tyo11m2wwwvkeso4&dl=0

Photoshop lists lens as 150-600mm

@DougRogers
Copy link
Author

DougRogers commented Sep 26, 2023

lensName returns 191
https://www.dropbox.com/scl/fi/xw7rw7pkfnrb0wsc77zbw/_NIK3285.NEF?rlkey=w45bbydlpt29ahnwwoyjkpvmq&dl=0

Photoshop lists lens as 60-600mm

@DougRogers
Copy link
Author

DougRogers commented Sep 26, 2023

lensName returns 182
https://www.dropbox.com/scl/fi/wmxbqn1uwtu9qkx34xl1r/_NIK3532.NEF?rlkey=6kyp85ofqex2i62qs8u3ixjsb&dl=0

Odd. Photoshop lists lens as 1000mm. I don't think that's right.

@DougRogers
Copy link
Author

DougRogers commented Sep 26, 2023

lensName returns 193

https://www.dropbox.com/scl/fi/xen5axvdl4qxpv1v4nwqo/_NIK3671.NEF?rlkey=t8ekw5lrgrz9izm7iz5ya2b1y&dl=0

Photoshop lists lens as 14-24mm

@DougRogers
Copy link
Author

@DougRogers
Copy link
Author

lensName returns 233

https://www.dropbox.com/scl/fi/860q9175py4v9sdm7pxli/JBG_0283.JPG?rlkey=pxnxvauj9m1wz2t2ghb72knw4&dl=0

Photoshop lists lens as 28-300mm

@norbertwg
Copy link
Contributor

I had a look at the samples.

  • The first image (red flower) seems to have incorrect meta data, as exiv2 gives a message "Warning: Directory Canon has an unexpected next pointer; ignored." Also the value of 65535 in Exif.CanonCs.LensType looks strange. It is the maximum value, which can be stored in that field, so I would interprete this as "n/a".
  • The second image (yellow flowers) looks similar, except that the value is 32767 - which is also outside the typical range.
  • ID 164: exiv2 0.28.0 shows Nikon AF-S Nikkor 70-200mm f/2.8E FL ED VR; are you using an older version of exiv2?
  • ID 129: exiv2 0.28.0 shows Sigma 150-600mm F5-6.3 DG OS HSM Sports
  • ID 191: if you can provide me the lens name, I can add the mapping
  • ID 182: exiv2 0.28.0 shows Nikon AF-S VR Nikkor 800mm f/5.6E FL ED; data look a little bit strange, looks like some of the data stored are wrong:
Exif.Photo.FocalLength            1000.0 mm
Exif.NikonLd3.FocalLength         1015.9 mm
Exif.NikonLd3.MinFocalLength       806.3 mm
Exif.NikonLd3.MaxFocalLength       806.3 mm
Exif.Photo.FocalLengthIn35mmFilm  1000.0 mm

  • ID 193: if you can provide me the lens name, I can add the mapping
  • ID 138: exiv2 0.28.0 shows Nikon AF-S VR Micro-Nikkor 105mm f/2.8G IF-ED
  • ID 233: exiv2 0.28.0 shows Canon EF 28-300mm f/3.5-5.6L IS USM

@DougRogers
Copy link
Author

DougRogers commented Sep 27, 2023

I am using version 0.28.0. Are the names you are showing coming directly from lensName? If you are using the executable, is it possible it is doing other processing to display the results?

Those mappings look correct, but I do not see those strings coming from the lensName function.

191: Sigma 60–600mm F4.5-6.3 DG OS HSM | Sports
193: Sigma 14-24mm f/2.8 DG HSM Art Lens

[EDIT] For 182. If a teleconverter was used, could that account for the data?

@DougRogers
Copy link
Author

I am using Windows x64.

@DougRogers
Copy link
Author

DougRogers commented Sep 28, 2023

I found the issue. I was using toString to get the name from the iterator. That works for everything in easyaccess except lensName

This works

            Exiv2::ExifData::const_iterator it = Exiv2::lensName(exifData);
            if (it != exifData.end())
            {
                auto value   = it->print(&exifData); // <<<----

This does not.

            Exiv2::ExifData::const_iterator it = Exiv2::lensName(exifData);
            if (it != exifData.end())
            {
                   auto value   = it->toString(); // <<<----

I am just getting 191 and 193 as id numbers now

@norbertwg
Copy link
Contributor

Regarding ID 182: a teleconverter could have impact on the data. But I think, there is no teleconverter with a factor of 1.25, which makes 1000 mm out of 800 mm. If just one of the tags would show 1000 mm, I would take into consideration, that the value was changed manually. But there 3 tags, and one with 1015.9 mm (which deviates a little bit, because that does not store the value itself but a logarithmic value. So I have no reasonable explanation.

Regarding 191 and 193 I will add the mapping.

@norbertwg
Copy link
Contributor

@DougRogers I think you were right with teleconverter. I found an andvertisement for "Nikon AF-S NIKKOR 800mm 5.6 E FL ED VR inkl. TC800 Konverter", Quote: "This premium lens comes with a special, custom-tuned 1.25x teleconverter that extends the focal length to 1,000mm at an effective speed of f/7 while maintaining superior imaging performance."

@kmilos kmilos added the lens Issue related to lens detection label Oct 2, 2023
@DougRogers
Copy link
Author

Calling the print function of the iterator correctly reports the lens name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug lens Issue related to lens detection
Projects
None yet
Development

No branches or pull requests

3 participants