You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/selective-manifests.md
+18-30Lines changed: 18 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -564,7 +564,7 @@ When building an ingredient archive, you can set `instance_id` on the ingredient
564
564
`instance_id` is only for identification and catalog lookups. It cannot be used as a linking key in `ingredientIds` when linking ingredient archives to actions — use `label` for that (see [Linking an archived ingredient to an action](#linking-an-archived-ingredient-to-an-action)).
565
565
566
566
```py
567
-
# Set instance_id when adding the ingredient to the archive builder
567
+
# Set instance_id when adding the ingredient to the archive builder.
568
568
builder = Builder.from_json(manifest_json)
569
569
withopen("photo-A.jpg", "rb") as f:
570
570
builder.add_ingredient(
@@ -778,40 +778,38 @@ An ingredient archive is a serialized `Builder` containing exactly one ingredien
@@ -831,22 +829,23 @@ After reading the ingredient details from an ingredient archive, the ingredient
831
829
832
830
Labels are only used as build-time linking keys. The SDK may reassign the actual label in the signed manifest.
833
831
834
-
Assign a `label` in the `add_ingredient()` call and reference that same label in `ingredientIds`. This works whether or not the ingredient has an `instance_id`.
832
+
Assign a `label` in the `add_ingredient()` call and reference that same label in `ingredientIds` to link an ingredient to an action.
@@ -867,7 +866,7 @@ with open("ingredient_archive.c2pa", "rb") as archive_file:
867
866
}
868
867
869
868
with Builder(manifest_json, context=ctx) as builder:
870
-
# The label on the ingredient matches the entry in ingredientIds
869
+
# The label on the ingredient must match the entry in ingredientIds on the action.
871
870
archive_file.seek(0)
872
871
builder.add_ingredient(
873
872
{
@@ -963,18 +962,7 @@ By default, `sign()` embeds the manifest directly inside the output asset file.
963
962
964
963
### Remove the manifest from the asset entirely
965
964
966
-
Use `set_no_embed()` so the signed asset contains no embedded manifest. The manifest bytes are returned from `sign()` and can be stored separately (as a sidecar file, on a server, etc.):
967
-
968
-
```mermaid
969
-
flowchart LR
970
-
subgraph Default["Default (embedded)"]
971
-
A1[Output Asset] --- A2[Image data + C2PA manifest]
972
-
end
973
-
974
-
subgraph NoEmbed["With set_no_embed()"]
975
-
B1[Output Asset] ~~~ B2[Manifest bytes with store as sidecar or uploaded to server]
976
-
end
977
-
```
965
+
Use `set_no_embed()` so the signed asset contains no embedded manifest store. The manifest store bytes are returned from `sign()` and can be stored separately (e.g. as a sidecar file).
978
966
979
967
```py
980
968
ctx = Context.from_dict({
@@ -987,9 +975,9 @@ builder.set_remote_url("<<URI/URL to remote storage of manifest bytes>>")
987
975
988
976
withopen("source.jpg", "rb") as source, open("output.jpg", "w+b") as dest:
0 commit comments