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/tasks/includes/_cpp-read.md
+18-9Lines changed: 18 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,16 +2,25 @@
2
2
Use the `read_file` function to read C2PA data from the specified file. This function examines the specified asset file for C2PA data and returns a JSON report if it finds any; it throws exceptions on errors. If there are validation errors, the report includes a `validation_status` field.
3
3
4
4
```cpp
5
-
auto json_store = C2pa::read_file("<ASSET_FILE>", "<DATA_DIR>")
6
-
```
5
+
#include<iostream>
6
+
#include<fstream>
7
+
#include<string>
8
+
#include<vector>
9
+
#include<stdexcept>
10
+
#include<openssl/evp.h>
11
+
#include<openssl/pem.h>
12
+
#include<openssl/err.h>
13
+
#include"c2pa.hpp"
14
+
#include"test_signer.hpp"
7
15
8
-
Where:
16
+
usingnamespacestd;
17
+
namespacefs = std::filesystem;
18
+
using namespace c2pa;
9
19
10
-
-`<ASSET_FILE>`- The asset file to read.
11
-
-`<DATA_DIR>` - Optional path to data output directory; If provided, the function extracts any binary resources, such as thumbnails, icons, and C2PA data into that directory. These files are referenced by the identifier fields in the manifest store report.
20
+
auto json_store = C2pa::read_file("work/media_file.jpg", "output/data_dir")
21
+
```
12
22
13
-
For example:
23
+
Where:
14
24
15
-
```cpp
16
-
auto json_store = C2pa::read_file("work/media_file.jpg", "output/data_dir")
17
-
```
25
+
- `work/media_file.jpg` is the asset file to read.
26
+
- `output/data_dir` is the optional path to data output directory; If provided, the function extracts any binary resources, such as thumbnails, icons, and C2PA data into that directory. These files are referenced by the identifier fields in the manifest store report.
Copy file name to clipboardExpand all lines: docs/tasks/includes/_python-read.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,15 @@ Use the `json()` method to return a JSON manifest report; If there are validatio
6
6
An asset file may contain many manifests in a manifest store. The most recent manifest is identified by the value of the `active_manifest` field in the manifests map.
0 commit comments