-
Notifications
You must be signed in to change notification settings - Fork 282
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 in Jp2 metadata writing & improvements in reading (2) #2155
Conversation
- add debug info when parsing Signature box - Move definitions & static stuff to anonymous namespace - cleanup while studying code - Make exceptions more similar to other formats
Codecov Report
@@ Coverage Diff @@
## main #2155 +/- ##
==========================================
+ Coverage 62.65% 62.72% +0.06%
==========================================
Files 97 98 +1
Lines 19721 19756 +35
Branches 9710 9722 +12
==========================================
+ Hits 12357 12391 +34
- Misses 5132 5133 +1
Partials 2232 2232
Continue to review full report at Codecov.
|
This pull request fixes 2 alerts when merging 1ad9e52 into 5d5354e - view on LGTM.com fixed alerts:
|
This doesn't impact the 0.27 backport, right?
I remember someone having the grand idea of merging jp2 and bmff image handlers at some point, that would be something ;) (w/ write support of course) |
No, the changes are the same. I do not need to re-do the work on 0.27 because we did not do the whole project clang-formatting there. I will keep in mind the possible merging of jp2 & BMPFF but I need to learn much more to address such task 😉 |
I used my admin powers to merge this PR without approval after 1 week without any feedback. |
Sorry, I meant to approve after you confirmed no more changes are needed! 🤦 |
No worries, all of us have exiv2 as a side project. I just have some more spare time lately and I wanted to move on 😸 |
This PR fix #2147 ( This is a rework of #2151. I wanted to squash some of the commits and also to deal with the recent clang-format changes introduced in
main
).After repeating the steps described by @cgilles I could easily reproduce the issue. Even by just creating a JP2 from scratch and then trying to read the metadata, the problem was reproducible (see unit test
Jp2Image.canWriteMetadataAndReadAfterwards
).The main issue was present at
Jp2Image::encodeJp2Header
when encoding thenewlen
of the Colour Specification Box. At that point we were indicating that the box was a bit bigger than it was in reality and the methodJp2Image::readMetadata
would detect that afterwads.I also did some improvements in
Jp2Image::readMetadata
andJp2Image::printStructure
so that we perform more checks as described in the JP2 standard. Due to some of these changes, I had to adapt some of the python tests.I will probably spend some more time in the future to make more improvements in the Jp2 support but I will do that in other branches.