Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Parents (ingredients) intake to sign from pre-existing Manifests #12

Open
oconpa opened this issue Jan 31, 2024 · 4 comments
Open

Parents (ingredients) intake to sign from pre-existing Manifests #12

oconpa opened this issue Jan 31, 2024 · 4 comments

Comments

@oconpa
Copy link

oconpa commented Jan 31, 2024

Can we add functionality to the sign_file sdk to extend a pre-existing Manifest incorporating it as a parent.

Original

result = c2pa.sign_file("path/to/source.jpg", "path/to/dest.jpg", manifest_json, sign_info, data_dir)

Proposed

result = c2pa.sign_file("path/to/source.jpg", "path/to/dest.jpg", manifest_json, sign_info, data_dir, ingredients=[Manifests])

This way we can include the parents that formed the child asset

@oconpa
Copy link
Author

oconpa commented Jan 31, 2024

The CLI aligns with this feature partially allowing one parent https://github.com/contentauth/c2patool?tab=readme-ov-file#usage

@gpeacock
Copy link
Contributor

gpeacock commented Oct 9, 2024

The new Builder API allows adding as many ingredients as you like:

builder = Builder(manifest_json)
builder.add_ingredient_file({ "title": "A.jpg", "relationship": "parentOf"}, "tests/fixtures/A.jpg")
result = builder.sign_file(signer, testFile, testOutputFile)

@gpeacock
Copy link
Contributor

gpeacock commented Oct 9, 2024

I'll be working on more convenience features, such as a simpler.

@gpeacock
Copy link
Contributor

gpeacock commented Oct 9, 2024

There can only be one parent ingredient, so there must be some way to indicate that.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants