-
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 #2151
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2151 +/- ##
=======================================
Coverage 63.25% 63.26%
=======================================
Files 97 98 +1
Lines 19154 19200 +46
Branches 9722 9743 +21
=======================================
+ Hits 12116 12146 +30
- Misses 4779 4796 +17
+ Partials 2259 2258 -1
Continue to review full report at Codecov.
|
This pull request fixes 2 alerts when merging bab0de5 into b2b6d83 - view on LGTM.com fixed alerts:
|
This pull request fixes 2 alerts when merging 3117967 into b2b6d83 - view on LGTM.com fixed alerts:
|
0x00, 0x14, 0x00, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
0x00, 0x00, 0xff, 0x93, 0xcf, 0xb4, 0x04, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0xff, 0xd9}; | ||
|
||
struct Jp2BoxHeader |
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.
Might make sense to use std::pair here.
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.
Can you provide an example of what you have in mind?
Hi Luis, I will compile your branch and check. Note : i don't receive a notification from github. Strange... Gilles |
Luis, I can confirm that digiKam recompiled with Exiv2 from your branch "mainFixJp2" do not corrupt JP2000 file when exported from JPEG in Image Editor: https://i.imgur.com/FF3iMeN.png Best Gilles |
Luis, did you back-port your JPEG2000 fix to the 0.27-maintenance branch ? |
@cgilles great, thanks for double checking. I did not port yet these changes to |
Thanks Luis for the feedback. The digiKam version that i use to test your branch is the future 8.0.0 where code is open to new implementations. This version is in alpha stage. I patched the Exiv2 interface in digiKam to compile with Exiv2 1.0.0 API. Best |
This has been backported from the work done in 'main' (#2151)
This has been backported from the work done in 'main' (#2151)
This has been backported from the work done in 'main' (#2151)
I am closing this PR because it was too painful to deal with the clanf-format changes here. New version of the PR is #2155 |
This has been backported from the work done in 'main' (Exiv2#2151)
This PR fix #2147
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.
@cgilles I would appreciate if you could double check if this branch fixes your issues.