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

Do not interpret OlympusEq.LensType 0 0 0 0 0 0 #3036

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sarunasb
Copy link

Olympus/OMDS cameras use '0 0 0 0 0 0' LensType, when mechanical lense is used. Currently Exiv2 interprets this into localised string ‘None’. However Olympus cameras traditionally allow to enter a custom string for lens name and then add that to Exif LensModel of images taken. Image processing software can take None from the LensType and ignore LensModel. Having LensType of '0 0 0 0 0 0' would allow for an easy if statement and then use LensModel instead.

@kmilos kmilos added lens Issue related to lens detection makerNote Anything related to one of the various supported MakerNote formats labels Aug 31, 2024
Copy link

codecov bot commented Sep 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.62%. Comparing base (77915ad) to head (eccf82c).
Report is 41 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3036      +/-   ##
==========================================
- Coverage   64.62%   64.62%   -0.01%     
==========================================
  Files         104      104              
  Lines       22239    22253      +14     
  Branches    10911    10923      +12     
==========================================
+ Hits        14371    14380       +9     
- Misses       5626     5628       +2     
- Partials     2242     2245       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kmilos
Copy link
Collaborator

kmilos commented Sep 4, 2024

Image processing software can take None from the LensType and ignore LensModel. Having LensType of '0 0 0 0 0 0' would allow for an easy if statement and then use LensModel instead.

Any clients are also free/should compare if the uninterpreted LensType value is {0,0,0,0,0,0} as the translated string can indeed be localized. Both the lib API and the CLI tool already let you get the uninterpreted value, so not convinced this is absolutely necessary...

Also note that the current behavior is consistent w/ exiftool: https://exiftool.org/TagNames/Olympus.html#LensType

@sarunasb
Copy link
Author

sarunasb commented Sep 4, 2024

Any clients are also free/should compare if the uninterpreted LensType value

Is that possible, when using API? (#3019)

@kmilos
Copy link
Collaborator

kmilos commented Sep 4, 2024

Is that possible, when using API?

value.toString() just a few lines above does exactly that. Works the same on Exifdatum object corresponding to the desired key (just passes to its internal value_->toString()):

exiv2/src/exif.cpp

Lines 336 to 338 in 44bc543

std::string Exifdatum::toString() const {
return value_ ? value_->toString() : "";
}

Only Exifdatum::write() calls through the special "pretty printer" functions that do the interpretation/translation.

@sarunasb
Copy link
Author

sarunasb commented Sep 10, 2024

Thanks for answering re. API.

I still don't think translating 0 lenstype to localised word is worth it. Especially in case of Olympus, where lensmodel can have lens name even with lenstype remaining 0, but appearing as None… ;)

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 makerNote Anything related to one of the various supported MakerNote formats
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants