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

Update Sony(1|2) tags #2323

Merged
merged 22 commits into from
Sep 27, 2022
Merged

Conversation

postscript-dev
Copy link
Collaborator

@postscript-dev postscript-dev commented Aug 11, 2022

Transcribe all tags (except for LensID) from main ExifTool Sony group into Exiv2.
Changes include:

  • Rename ColorReproduction -> CreativeStyle and LongExposureNoiseReduction -> FocusMode3 to reflect use.
  • Rename 0x* tagnames to equivalent ExifTool tags (e.g., 0x2006 -> Sharpness)
  • Rename duplicate tagnames (e.g., DynamicRangeOptimizer (0xb04f) to DynamicRangeOptimizer2)
  • Remove tag entries that are Groups (e.g., ShotInfo).
  • Separate some common Sony/Minolta data as the camera types use different values (e.g., Quality)
  • All exiv2-Sony*.exv and some exiv2_pr2323-coverage*.exv test files are from ExifTool Sony samples (https://exiftool.org/Sony.tar.gz).

ExifTool Sony tags sources:
https://www.exiftool.org/TagNames/Sony.html
https://github.com/exiftool/exiftool/blob/1e17485cbb372a502e5b9d052d01303db735e6fa/lib/Image/ExifTool/Sony.pm

@postscript-dev postscript-dev changed the title Update sony tags Update Sony(1|2) tags Aug 11, 2022
@postscript-dev postscript-dev self-assigned this Aug 11, 2022
@postscript-dev postscript-dev added lens Issue related to lens detection prettyPrinter Anything related to the output formatting of a value labels Aug 11, 2022
@codecov
Copy link

codecov bot commented Aug 11, 2022

Codecov Report

Merging #2323 (7919327) into main (640b0fb) will increase coverage by 0.62%.
The diff coverage is 82.02%.

@@            Coverage Diff             @@
##             main    #2323      +/-   ##
==========================================
+ Coverage   63.51%   64.14%   +0.62%     
==========================================
  Files         119      119              
  Lines       20634    21099     +465     
  Branches    10245    10425     +180     
==========================================
+ Hits        13106    13534     +428     
- Misses       5399     5408       +9     
- Partials     2129     2157      +28     
Impacted Files Coverage Δ
src/easyaccess.cpp 93.10% <ø> (ø)
src/minoltamn_int.cpp 60.98% <ø> (+5.92%) ⬆️
src/sonymn_int.cpp 77.36% <80.56%> (+19.15%) ⬆️
src/tags_int.hpp 91.17% <93.33%> (+2.80%) ⬆️
src/makernote_int.cpp 65.39% <0.00%> (+0.76%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

src/sonymn_int.cpp Fixed Show fixed Hide fixed
src/sonymn_int.cpp Fixed Show fixed Hide fixed
src/tags_int.hpp Fixed Show fixed Hide fixed
@postscript-dev
Copy link
Collaborator Author

postscript-dev commented Aug 11, 2022

One tag in this PR that may be of interest to darktable developers is ExifTool's Sony LensSpec tag (0xb02a). This is set by compatible lenses and the translated output contains the focal length, aperture and some additional information (e.g., SAM, Fish-eye, etc). Incompatible lenses are translated as Unknown.

To test my PR, I have been using ExifTool's Sony JPEG samples which contain examples of the many different Sony camera types. This sample set includes lots of different lens examples. If I process the files with

$ exiv2 -Pxkvt -K Exif.Sony1.LensID -K Exif.Sony1.LensSpec *.jpg 2>/dev/null > exiv2-LensID_LensSpec_tags.txt

the exiv2-LensID_LensSpec_tags.txt file demonstrates the new tag.

The file shows that LensSpec produces output in circumstances where we don't have translations for LensID. In addition, LensSpec includes values for cameras which have a fixed lens and therefore don't have a LensID tag. For example, my fixed lens Sony DSC-HX60V camera has a LensSpec value of 24-720mm F3.5-6.3 which is also listed as the lens in Sony's PlayMemories Home software.

I wasn't planning to backport everything in this PR but I am willing to work on the LensSpec tag.

@postscript-dev
Copy link
Collaborator Author

Recently it was decided that we can add lenses to exiv2 without a corroborating image, so I looked at adding the ExifTool Sony/Minolta lenses. I formatted the ExifTool lenses into an exiv2 array and can now see that there are lots of differences.

As I don't have enough experience with lenses I don't plan to finish this task. If someone else wants to work on this, the formatted array is available in exiftool_SonyMinolta-lens-in-exiv2-format.txt. You can do a diff with the array in

exiv2/src/minoltamn_int.cpp

Lines 1027 to 1030 in 3ac7608

extern TagDetails const minoltaSonyLensID[] = {
{0, "Minolta AF 28-85mm F3.5-4.5 New"},
{1, "Minolta AF 80-200mm F2.8 HS-APO G"},
{2, "Minolta AF 28-70mm F2.8 G"},

to find the problems.

@kevinbackhouse
Copy link
Collaborator

@postscript-dev: I made one final suggestion in postscript-dev#6 and then I am happy with the code changes. (I'm not qualified to comment on the tag changes because I don't know anything about cameras!)

Transcribe all tags (except for `LensID`) from main ExifTool Sony
group into Exiv2.
Changes include:
- Rename `ColorReproduction` -> `CreativeStyle` and
  `LongExposureNoiseReduction` -> `FocusMode3` to reflect use.
- Rename `0x*` tagnames to equivalent ExifTool tags (e.g.,
  `0x2006` -> `Sharpness`).
- Remove tag entries that are Groups (e.g., `ShotInfo`).
- Separate some common Sony/Minolta data as the camera types use
  different values (e.g., `Quality`)
- Additional `exiv2-Sony*.exv` test files come from ExifTool Sony
  samples (https://exiftool.org/Sony.tar.gz).

ExifTool Sony tags sources:
https://www.exiftool.org/TagNames/Sony.html
https://github.com/exiftool/exiftool/blob/1e17485cbb372a502e5b9d052d01303db735e6fa/lib/Image/ExifTool/Sony.pm
Make finding the Sony model more resilient by also using
`SonyModelID`.
@postscript-dev
Copy link
Collaborator Author

@kevinbackhouse:
Thanks for the suggestion, I have made the changes.

@postscript-dev
Copy link
Collaborator Author

@kevinbackhouse
Thanks for taking the time to reviewing this, it was a big PR. As you are not confident about cameras tags, I will leave this for a couple of days to see if anyone else has comments. After that I plan to merge.

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 prettyPrinter Anything related to the output formatting of a value
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants