Skip to content

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

Closed

Description

@oconpa

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

Activity

  1. oconpa commented on Jan 31, 2024

    @oconpa
    Author

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

  2. gpeacock commented on Oct 9, 2024

    @gpeacock
    Member

    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)
    
  3. gpeacock commented on Oct 9, 2024

    @gpeacock
    Member

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

  4. gpeacock commented on Oct 9, 2024

    @gpeacock
    Member

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

  5. tmathern commented on Nov 26, 2025

    @tmathern
    Collaborator

    I am closing this issue because the v2 spec enforces that there is only one parent ingredient.
    And the add_ingredient API on the Builder let you add as many ingredients as you want.

    I'd suggest updating to latest released version and investigating if the requested behavior can be achieved there (with the caveat mentioned above about having only one parent ingredient).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions