Skip to content

Commit ceeae56

Browse files
author
Tania Mathern
committed
fix: Notes for WIP
1 parent b99f819 commit ceeae56

4 files changed

Lines changed: 7 additions & 0 deletions

File tree

examples/no_thumbnails.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ def callback_signer_es256(data: bytes) -> bytes:
106106
print("No thumbnail in the manifest as per settings.")
107107
else:
108108
print("Thumbnail found in the manifest.")
109+
110+
# TODO-TMN: use with context here
109111
context.close()
110112

111113
print("\nExample completed successfully!")

examples/read.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def load_trust_anchors():
3131
def read_c2pa_data(media_path: str):
3232
print(f"Reading {media_path}")
3333
try:
34+
# TODO-TMN: use with context here
3435
settings = load_trust_anchors()
3536
context = c2pa.Context(settings=settings)
3637
with c2pa.Reader(media_path, context=context) as reader:

examples/sign.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ def callback_signer_es256(data: bytes) -> bytes:
112112
# Without loaded trust settings,
113113
# the manifest validation_state will be "Invalid".
114114
print(reader.json())
115+
116+
# TODO-TMN: use with context here
115117
context.close()
116118

117119
print("\nExample completed successfully!")

examples/training.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ def getitem(d, key):
127127

128128
# As an alternative, you can also use file paths directly during signing:
129129
# builder.sign_file(testFile, testOutputFile, signer)
130+
# TODO-TMN: use with context here
130131
context.close()
131132

132133
except Exception as err:
@@ -155,6 +156,7 @@ def getitem(d, key):
155156
uri = getitem(manifest,("ingredients", 0, "thumbnail", "identifier"))
156157
with open(output_dir + "thumbnail_v2.jpg", "wb") as thumbnail_output:
157158
reader.resource_to_stream(uri, thumbnail_output)
159+
# TODO-TMN: use with context here
158160
context.close()
159161

160162
except Exception as err:

0 commit comments

Comments
 (0)