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

[nikon] Add instructions for adding new Nikon F mount lenses #2071

Merged
merged 1 commit into from
Feb 28, 2022

Conversation

Sturmflut
Copy link
Contributor

  • Also cleans up a dead link

piponazo
piponazo previously approved these changes Feb 8, 2022
Copy link
Collaborator

@piponazo piponazo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Thanks! ❤️

Comment on lines 1911 to 1938
// lid: LensIDNumber
// stps: LensFStops
// focs: MinFocalLength
// focl: MaxFocalLength
// aps: MaxApertureAtMinFocal
// apl: MaxApertureAtMaxFocal
// lfw: MCUVersion
// ltype: LensType
//
// The tcinfo, dblid and mid fields are being ignored.
//
// Please note that all fields except LensType have to be looked up in the
// Exif.NikonLd* prefix and not other Exif.Nikon* prefixes. For example: for modern
// Nikon bodies with modern lenses, there will be both a Exif.Nikon3.LensFStops and a
// Exif.NikonLd3.LensFStops entry in the EXIF data. You are looking for
// Exif.NikonLd3.LensFStops.
//
// In most cases the necessary hex values should be extracted from a test image using
// the following command:
//
// exiv2 -ph -g NikonLd3.LensIDNumber -g NikonLd3.LensFStops \
// -g NikonLd3.MinFocalLength -g NikonLd3.MaxFocalLength \
// -g NikonLd3.MaxApertureAtMinFocal -g NikonLd3.MaxApertureAtMaxFocal\
// -g NikonLd3.MCUVersion -g Nikon3.LensType test.NEF
//
//------------------------------------------------------------------------------
// Nikkor lenses by their LensID
//------------------------------------------------------------------------------
Copy link
Member

@hassec hassec Feb 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There already is a wiki entry that explains adding a lens.

So maybe just point to that one from here? (And potentially add the above command to improve the wiki)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I did not notice the wiki entry. Probably we can use this information to improve the wiki and then just add here a link to the wiki.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think all documentation that is necessary to continue developing the code should be part of the the release tarball. The wiki is not part of the release. So I think it should rather be the other way around: The Wiki should have a link to this file, or there should be a document in docs/ that has the information.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've made a good point @Sturmflut . On the other hand, nowadays, anyone contributing to the project must have an internet connection and therefore access to the Wiki.

I have a slight preference for moving these notes to the wiki. The lenses topic is quite involved and not unique to the file src/nikonmn_int.cpp. What are your thoughts @hassec ? I can see you were the last one editing the wiki page.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now the documentation situation is admittedly not that great as it is a bit spread across md files in the root and doc/ dir as well as the wiki.
I'd prefer to have it in the wiki too, as that's where we already have info about "adding a lens".

Having the doc in the source file, IMHO, kind of defeats the purpose a bit because the user would have to already know a lot of implementation details to ever find this documentation

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took the freedom to extend the wiki page with the information provided here (I hope this is fine for you @Sturmflut ):
https://github.com/Exiv2/exiv2/wiki/Adding-a-new-lens

I would suggest to keep lines 1911-1920 which provided relevant information in the context of understanding the fields of the structure. And replace replace the other lines for a reference to the wiki page.

Would that work for you guys?

@hassec hassec added documentation lens Issue related to lens detection labels Feb 8, 2022
@codecov
Copy link

codecov bot commented Feb 8, 2022

Codecov Report

Merging #2071 (180a2da) into main (4ae42b1) will decrease coverage by 0.21%.
The diff coverage is n/a.

❗ Current head 180a2da differs from pull request most recent head 50f34f4. Consider uploading reports for the commit 50f34f4 to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2071      +/-   ##
==========================================
- Coverage   62.08%   61.87%   -0.22%     
==========================================
  Files          96       96              
  Lines       19153    19059      -94     
  Branches     9798     9782      -16     
==========================================
- Hits        11891    11792      -99     
- Misses       4967     4984      +17     
+ Partials     2295     2283      -12     
Impacted Files Coverage Δ
src/nikonmn_int.cpp 46.76% <ø> (ø)
src/safe_op.hpp 69.23% <0.00%> (-27.65%) ⬇️
include/exiv2/slice.hpp 69.64% <0.00%> (-21.89%) ⬇️
include/exiv2/error.hpp 60.71% <0.00%> (-4.81%) ⬇️
src/utils.cpp 38.46% <0.00%> (-1.93%) ⬇️
include/exiv2/value.hpp 82.68% <0.00%> (-0.56%) ⬇️
src/enforce.hpp 75.00% <0.00%> (+2.77%) ⬆️
src/getopt.cpp 67.30% <0.00%> (+5.76%) ⬆️
include/exiv2/metadatum.hpp 88.88% <0.00%> (+16.16%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4ae42b1...50f34f4. Read the comment docs.

Copy link
Collaborator

@piponazo piponazo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution. I am merging this as it is. We can decide later if part of the documentation is redundant and if we should chop part from it from the source file.

@piponazo
Copy link
Collaborator

Thanks for the contribution. I am merging this as it is. We can decide later if part of the documentation is redundant and if we should chop part from it from the source file.

Ups I can't. @hassec do you have a strong position about not merging this until we chop part of the doc? I can do it afterwards in another PR. I just want to unblock some of the open PRs (which are blocked for small details)

@piponazo piponazo merged commit ac9b9e2 into Exiv2:main Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation lens Issue related to lens detection
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants