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
This function examines the specified media file for C2PA data and generates a JSON report of any data it finds. If there are validation errors, the report includes a `validation_status` field. For a summary of supported media types, see [Supported file formats](#supported-file-formats).
@@ -42,10 +42,10 @@ NOTE: For a comprehensive reference to the JSON manifest structure, see the [CAI
42
42
43
43
### Add a signed manifest to a media file
44
44
45
-
Use the `add_manifest_to_file_json` function to add a signed manifest to a media file.
45
+
Use the `sign_file` function to add a signed manifest to a media file.
46
46
47
47
```py
48
-
result = c2pa.add_manifest_to_file_json("path/to/source.jpg",
For the list of supported signing algorithms, see [Creating and using an X.509 certificate](https://opensource.contentauthenticity.org/docs/c2patool/x_509).
@@ -124,7 +124,21 @@ We use [PyTest](https://docs.pytest.org/) for testing.
124
124
Run tests by entering this command:
125
125
126
126
```
127
+
source .venv/bin/activate
128
+
maturin develop
127
129
pytest
130
+
deactivate
131
+
```
132
+
133
+
### Example
134
+
135
+
Run the example code like this:
136
+
137
+
```
138
+
source .venv/bin/activate
139
+
maturin develop
140
+
python3 tests/training.py
141
+
deactivate
128
142
```
129
143
130
144
## Supported file formats
@@ -147,6 +161,19 @@ pytest
147
161
|`wav`|`audio/x-wav`|
148
162
|`webp`|`image/webp`|
149
163
164
+
165
+
## Change Notes:
166
+
167
+
Version 0.3.0 changes:
168
+
There are some breaking changes to align with future APIs:
169
+
-`C2paSignerInfo` moves the `alg` to the first parameter from the 3rd.
170
+
-`c2pa.verify_from_file_json` is now `c2pa.read_file`.
171
+
-`c2pa.ingredient_from_file_json` is now `c2pa.read_ingredient_file`.
172
+
-`c2pa.add_manifest_to_file_json` is now `c2pa.sign_file`.
173
+
- There are many more specific errors types now, and Error messages always start with the name of the error i.e (str(err.value).startswith("ManifestNotFound")).
174
+
- The ingredient thumbnail identifier may be jumbf uri reference if a valid thumb already exists in the active manifest.
175
+
- Extracted file paths for read_file now use a folder structure and different naming conventions.
176
+
150
177
## License
151
178
152
179
This package is distributed under the terms of both the [MIT license](https://github.com/contentauth/c2pa-rs/blob/main/LICENSE-MIT) and the [Apache License (Version 2.0)](https://github.com/contentauth/c2pa-rs/blob/main/LICENSE-APACHE).
0 commit comments