Bindings for c2pa_reader_with_manifest_data_and_stream and c2pa_reader_with_fragment#237
Open
tmathern wants to merge 8 commits into
Open
Bindings for c2pa_reader_with_manifest_data_and_stream and c2pa_reader_with_fragment#237tmathern wants to merge 8 commits into
c2pa_reader_with_manifest_data_and_stream and c2pa_reader_with_fragment#237tmathern wants to merge 8 commits into
Conversation
c2pa_reader_with_manifest_data_and_stream and c2pa_reader_with_fragmentc2pa_reader_with_manifest_data_and_stream and c2pa_reader_with_fragment
gpeacock
reviewed
Jun 23, 2026
|
|
||
| c2pa_reader = c2pa_reader_from_context(context.c_context()); | ||
| if (c2pa_reader == nullptr) { | ||
| throw C2paException("Failed to create reader from context"); |
Member
There was a problem hiding this comment.
Why not use C2paException here?
gpeacock
approved these changes
Jun 23, 2026
gpeacock
left a comment
Member
There was a problem hiding this comment.
A few questions but otherwise this looks fine.
| throw C2paException("Invalid Context provider IContextProvider"); | ||
| } | ||
| if (manifest_jumbf.empty()) { | ||
| throw C2paException("manifest_jumbf must not be empty"); |
Member
There was a problem hiding this comment.
If we don't have these checks in c_fii, we should add them there. Not required for this PR, but just wondering why we need to do extra validation at this level.
| ensure_initialized(); | ||
|
|
||
| // Wrap both streams for the FFI call. | ||
| fragment_main_stream = std::make_unique<CppIStream>(stream); |
Member
There was a problem hiding this comment.
why are these not on the stack in this method?
| }; | ||
|
|
||
| TEST_F(ReaderSidecarTest, ReaderCanReadSidecar) { | ||
| auto sc = make_test_sidecar_bytes(c2pa_test::get_fixture_path("C.jpg"), "image/jpeg"); |
Member
There was a problem hiding this comment.
using C.jpg with an existing manifest is an interesting test in this case, the asset produced should have the manifest stripped and the manifest store should have two manifest in it. It is more complicated than a simple asset, but it should work.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
c2pa_reader_with_manifest_data_and_streamshould solve [Feature Request] Support for verifying sidecar/external manifests with decoupled image streams #118. Note that the proposed API is slightly different to use the current iteration of the Context API.c2pa_reader_with_fragmentis to add video streaming support as defined in spec.