-
Notifications
You must be signed in to change notification settings - Fork 287
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
Canon cr3 previews #1958
Canon cr3 previews #1958
Conversation
Added test data Canon-R6-pruned.CR3 (first 492016 bytes of https://raw.pixls.us/getfile.php/4659/nice/Canon%20-%20Canon%20EOS%20R6%20-%203:2.CR3). See Exiv2#1893
This pull request introduces 1 alert when merging 3717a90 into 4901c5d - view on LGTM.com new alerts:
|
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.
This looks good, @dhoulder. It builds and passes the test suite.
Several comments:
-
I'd like somebody else to review and approve this as it will have to be approved on 0.27-maintenance after v0.27.5 ships next week. I want out of the loop.
-
Is using
import hashlib
part of the "standard" python3 installation? -
I added something to the test suite for dealing with temporary files. See test_issue_1484.py You might find that useful (or your might not). I can't find the carcass of your temporary extracted files. The test suite on 'main' has a different user experience from 0.27-maintenance, so I'm not sure what it's doing. I ran you test manually as follows:
$ 677 rmills@rmillsm1:~/gnu/github/exiv2/main/tests $ python3 runner.py --verbose bugfixes/github/test_issue_1893.py
test_run (test_issue_1893.issue_1893_cr3_preview) ... ok
----------------------------------------------------------------------
Ran 1 test in 0.033s
OK
678 rmills@rmillsm1:~/gnu/github/exiv2/main/tests $
- I'm unclear if you've addressed the issue we discussed about needlessly allocating and reading the mdat box.
Thanks @clanmills
Yes. Even exists in python 2. https://docs.python.org/3/library/hashlib.html says "Constructors for hash algorithms that are always present in this module are sha1(), sha224(), sha256(), sha384(), sha512(), blake2b(), and blake2s()."
No not yet. I wanted to fix and test one thing at a time.
Feature, not a bug 😄 . I didn't want to litter test/data with output files. They're generated in a temporary directory that python guarantees to remove when self.preview_image_tmp_dir goes out of scope. I've discovered that there's a wrong format descriptor in Internal::stringFormat("width,height,size = %u,%u,%ld", ...). Should be "width,height,size = %u,%u,%u". I'm not sure if I can "fix" a pull request or if I have to submit another one - will investigate. |
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.
Well done, @dhoulder. You've discovered that you can update the PR. You have to set the tracked branch. I use SmartGit to do that because I don't understand git.
Codecov Report
@@ Coverage Diff @@
## main #1958 +/- ##
==========================================
+ Coverage 61.12% 61.28% +0.15%
==========================================
Files 96 96
Lines 19068 19079 +11
Branches 9745 9748 +3
==========================================
+ Hits 11656 11692 +36
+ Misses 5093 5069 -24
+ Partials 2319 2318 -1
Continue to review full report at Codecov.
|
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.
Minor cosmetic changes while we're at it.
Looks good otherwise!
@clanmills: It seems like the macOS |
Co-authored-by: Miloš Komarčević <4973094+kmilos@users.noreply.github.com>
Co-authored-by: Miloš Komarčević <4973094+kmilos@users.noreply.github.com>
@clanmills wrote:
Ah, yes that's probably a bit more succinct than my approach. Next time… |
@dhoulder Do nothing. What you have works. @kevinbackhouse Groan. I'm surprised. My MBP has the M1 chip and build David's code without issue. There was another PR which used When I attempted to use that for v0.27.5 RC3, it didn't deliver happiness although I didn't know why not. What a miserable thing. I'm on vacation at the moment. I expect we'll revisit this next week before v0.27.5 gets safely out the door. |
Ignore the Mac build failures. I have created #1962 to try to fix that. |
I see #1962 is merged. Do I need to do something to rerun the checks? |
@dhoulder. You're probably good. When I want to force a rebuild, I submit a cosmetic change (add a space to a comment in the code), update the PR and label the change as "build trigger". There are probably smarter ways that I don't know. If it fails on macOS, you can apply the code change from #1962 to this PR and see what happens. I'll build your code on my machines, although I don't expect any issues. My MacBookPro has the M1 processor and the latest Xcode (13.0). The MacMini is Intel, however the latest Xcode can't be installed (can't install on your 7 year old machine, buy a new MacMini, sucker), so it's stuck at 12.1. I don't know what the CI uses to build, however I expect it to be apparent in the build transcript. |
Is this ready to merge? |
@dhoulder The builds on the MacBookPro/M1/Xcode13 and MacMini/Intelx64/Xcode12.1 are both good. @kevinbackhouse I think David has to do a rebase merge or something to update the code base of this PR. When he submits that change, the CI will run and pass. Then we can approve and merge this branch. How does David update the code base for this PR? When I build v0.27.5 (probably Thursday 2021-10-21), I'll update cmake/compilerFlags.cmake from:
to:
|
I can just do a "squash and merge" if you would like this to be squashed into a single commit. |
I can use mergify to backport #1962 to 0.27-maintenance. Should this PR be backported too? |
Thank, @kevinbackhouse I'm happy to merge cmake/ changes into 0.27-maintenance for v0.27.5 GM. I don't want C++ code changes in 0.27-maintenance until after we have shipped. |
@clanmills: ok, thanks. I created #1966 to backport the cmake changes. @dhoulder: Do you think this should be back-ported to the 0.27-maintenance branch? If so, please could you add a comment like this one to this PR? It won't get merged until after v0.27.5 has shipped though. |
@Mergifyio backport 0.27-maintenance |
🟠 Waiting for conditions
|
Hi @kevinbackhouse , @clanmills : Thanks for your help.
Done. I had "backport to 0.27" on my to-do list, but I'll scrub that now.
Yep, fine by me. Thanks. For the record I manged to trigger the CI rerun with |
* Extract THMB and PRVW images from Canon CR3 file * Added test for Canon CR3 preview extraction. Added test data Canon-R6-pruned.CR3 (first 492016 bytes of https://raw.pixls.us/getfile.php/4659/nice/Canon%20-%20Canon%20EOS%20R6%20-%203:2.CR3). See #1893 * Fixed format specifier * Update src/bmffimage.cpp Co-authored-by: Miloš Komarčević <4973094+kmilos@users.noreply.github.com> * Update src/bmffimage.cpp Co-authored-by: Miloš Komarčević <4973094+kmilos@users.noreply.github.com> * retrigger checks Co-authored-by: Miloš Komarčević <4973094+kmilos@users.noreply.github.com> (cherry picked from commit b385f2d)
✅ Backports have been created
|
@dhoulder Thank You very much for working on this David. Very valuable contribution. I've updated #1893 to ask @paolobenve to build and test with his CR3 files. @kevinbackhouse Thank You very much for taking care of the integration, Kev. |
* Extract THMB and PRVW images from Canon CR3 file * Added test for Canon CR3 preview extraction. Added test data Canon-R6-pruned.CR3 (first 492016 bytes of https://raw.pixls.us/getfile.php/4659/nice/Canon%20-%20Canon%20EOS%20R6%20-%203:2.CR3). See #1893 * Fixed format specifier * Update src/bmffimage.cpp Co-authored-by: Miloš Komarčević <4973094+kmilos@users.noreply.github.com> * Update src/bmffimage.cpp Co-authored-by: Miloš Komarčević <4973094+kmilos@users.noreply.github.com> * retrigger checks Co-authored-by: Miloš Komarčević <4973094+kmilos@users.noreply.github.com> (cherry picked from commit b385f2d)
Canon cr3 previews (backport #1958)
* Extract THMB and PRVW images from Canon CR3 file * Added test for Canon CR3 preview extraction. Added test data Canon-R6-pruned.CR3 (first 492016 bytes of https://raw.pixls.us/getfile.php/4659/nice/Canon%20-%20Canon%20EOS%20R6%20-%203:2.CR3). See Exiv2#1893 * Fixed format specifier * Update src/bmffimage.cpp Co-authored-by: Miloš Komarčević <4973094+kmilos@users.noreply.github.com> * Update src/bmffimage.cpp Co-authored-by: Miloš Komarčević <4973094+kmilos@users.noreply.github.com> * retrigger checks Co-authored-by: Miloš Komarčević <4973094+kmilos@users.noreply.github.com> (cherry picked from commit b385f2d)
Extract previews from Canon CR3 files.
Fixes #1893