-
Notifications
You must be signed in to change notification settings - Fork 292
Fix_1368 Sigma 18-35mm f/1.8 DC HSM (master only) #1381
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
import system_tests | ||
|
||
class Canon_Sigma_18_35_F18_DC_HSM(metaclass=system_tests.CaseMeta): | ||
url = "https://github.com/Exiv2/exiv2/issues/1368" | ||
|
||
filename1 = "$data_path/Canon_Sigma_18_35_F18_DC_HSM_firmware_1xx.exv" | ||
filename2 = "$data_path/Canon_Sigma_18_35_F18_DC_HSM_firmware_2xx.exv" | ||
commands = ["$exiv2 -pa -K Exif.CanonCs.LensType $filename1", | ||
"$exiv2 -pa -K Exif.CanonCs.LensType $filename2"] | ||
stderr = ["", ""] | ||
stdout = [ | ||
"""Exif.CanonCs.LensType Short 1 Sigma 18-35mm f/1.8 DC HSM | A | ||
""", | ||
"""Exif.CanonCs.LensType Short 1 Sigma 18-35mm f/1.8 DC HSM | A | ||
""" | ||
] | ||
retval = [0, 0] |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am a little surprised to see that we do not need here the line:
which you included at
0.27-maintenance
. Although I do not know this part of the code well enough to determine if it is needed or not.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's because in this branch, there's only one entry for lens model
368
, so it does not need special disambiguation. The extra commit I included (which you're commenting on) was just to make all 3 entries for the same lens to have identical names. But this is for model137
, which my particular lens never used, and I can't produce the necessary sample files and that's why this is not included in the test suite.Note that there is a line for
137
:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hang on, gentlemen (@lbschenkel). If this works, let's include it in the code as it may resolve a future "disambiguation". For that matter, is there stuff in 0.27-maintenance that should be ported forward to 'master'?
I "sort of" know this code. However, it's messy. One day we'll fix this "properly" with M2Lscript.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I'm confused now.
What do you mean by this? Let me clarify things:
My PR to branch 0.27 was to fix lens model
368
, which is the new lens model reported by this lens on firmware 2.x. On firmware 1.x the lens model was150
. That branch correctly recognized model150
but not368
, so I added it and I also fixed the disambiguation for lens368
(added theprintCsLensByFocalLength
), which was broken. Then I introduced the tests for models150
and368
, since I had actual images with those model numbers.In addition, I noticed that model
137
also refers to the same lens, but the name was slightly different than the other entries, so I changed it to match and have consistent naming everywhere. This is not part of the fix, and that is why I did it on a separate commit, but for this I didn't add any unit tests since I don't have a single image for this lens with model137
(maybe this model was only used in very old firmware?) -- I know I can create one by playing with the model number, but I presumed that you want real metadata from the wild in the test suite, not stuff that was fudged to match the code (the code is supposed to be the one matching what is seen in the wild, not the other way around).This PR only introduces the tests, because both lens models
150
and368
work in this branch. In particular, the single368
entry is this particular lens [1], so there's no need to have special disambiguation logic (printCsLensByFocalLength
).In addition, the same extra commit was included here for the same reasons.
[1] I think this is probably another lens detection bug in
master
, since from the history of 0.27 branch I can see that the additional368
lenses were ported fromexiftool
, so those are most likely genuine. The bug in0.27
was that this "import" overwrote the pre-existing368
lens.I hope this clarifies it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so, @lbschenkel. Thanks for the clarification.