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

fix(canon): cleanup canonAf2 and canonAf3 related code #2089

Merged
merged 1 commit into from
Feb 13, 2022

Conversation

hassec
Copy link
Member

@hassec hassec commented Feb 11, 2022

this PR is targeting @alexvanderberkel's canon tags PR.

@alexvanderberkel there is a lot of unused code in canonmn_int.cpp but I've tried to only focus on the Af2 and Af3 fields here.
I think we should include this to make it more obvious that e.g. tagListAf2() just never gets called.

@codecov
Copy link

codecov bot commented Feb 11, 2022

Codecov Report

❗ No coverage uploaded for pull request base (update_canon_tags_2@6479fd5). Click here to learn what that means.
The diff coverage is n/a.

❗ Current head 7e216f2 differs from pull request most recent head 18eecad. Consider uploading reports for the commit 18eecad to get more accurate results

Impacted file tree graph

@@                  Coverage Diff                   @@
##             update_canon_tags_2    #2089   +/-   ##
======================================================
  Coverage                       ?   61.97%           
======================================================
  Files                          ?       96           
  Lines                          ?    19055           
  Branches                       ?     9782           
======================================================
  Hits                           ?    11810           
  Misses                         ?     4962           
  Partials                       ?     2283           

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 6479fd5...18eecad. Read the comment docs.

@alexvanderberkel
Copy link
Member

@hassec The question is if we would like to get to a point where we have the same tags as the Exiftool in Exiv2. Removing them would go into the opposite direction

@hassec
Copy link
Member Author

hassec commented Feb 11, 2022

@alexvanderberkel I'm not sure if I understand that point. The changes here only remove dead code. There are no functional changes. And exiv2 can't possibly decode the AFInfo fields using these taglists. This has to happen via the special decoder in tiffvisitor_int.cpp

@alexvanderberkel
Copy link
Member

might be that I made a mistake or havent coded it correctly. Reason why I added the tags is https://exiftool.org/TagNames/Canon.html#AFInfo2 which slidely differ from AFInfo
image

@hassec
Copy link
Member Author

hassec commented Feb 11, 2022

So in exiv2 we currently only support canon's AFInfo2 tag. The others simply aren't supported yet.

Maybe it's easiest to have a quick chat on matrix to get on the same page? 😉

@clanmills
Copy link
Collaborator

I'm going to keep out of this. Really pleased:

  1. Significant progress with the Canon Tags.
  2. Really great team-work. @piponazo performed the git magic to transition from Update canon tags #1628 to Update canon tags 2 #2087
  3. Very thoughtful code review by @hassec
  4. And while the canon tags are proceeding, miracles are being performed on DOS/Greek Paths, lens recognition, documentation corrections about test. And more ... (skip boring details)

Have a great weekend, everybody.

@piponazo
Copy link
Collaborator

I have mixed feelings about this. On the one hand it is true that right now that code is "Dead Code". On the other hand, it might be simple to cover that code by adding a new test?

@hassec
Copy link
Member Author

hassec commented Feb 13, 2022

No, it's not "dead" in a way that it's not called because we don't have a file that needs it.

It's dead in the sense that there is no c++ code path that could possibly ever invoke these lines.
And further, because AFInfo tags in the canon maker note are variable length they can't possibly be decoded in the way that all the other tags in canonmn_int.cpp are.
That's what the special decoder in tiffvisitor_int.cpp does.

@piponazo
Copy link
Collaborator

Oh ... I understand now. Then for me it is fine to get rid of this. Anyways, I'll leave the approval for @alexvanderberkel , since I do not want to interfere with decisions on the work being done at update_canon_tags_2

@clanmills
Copy link
Collaborator

clanmills commented Feb 13, 2022

@hassec is correct that the CanonAF data structures are dead code. They should not have been included in PR #981.

I'm very pleased that @hassec has understood the purpose of TiffDecoder::decodeCanonAFInfo(). I had to invent that to deal with the dynamic arrays in the Canon AF metadata. I also had to add a new generic value printer printBitmask().

@alexvanderberkel
Copy link
Member

For me it would be okay now to remove it! Thanks @hassec

@hassec hassec merged commit 5c385b5 into update_canon_tags_2 Feb 13, 2022
@hassec hassec deleted the chasse_canonAf_cleanup branch February 13, 2022 21:42
@clanmills
Copy link
Collaborator

@hassec and @alexvanderberkel I have removed the discussion about tagInfo and opened a new issue. #2097

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

Successfully merging this pull request may close these issues.

4 participants