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: README.md
+43-41Lines changed: 43 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,10 +14,8 @@ Install from PyPI by entering this command:
14
14
pip install -U c2pa-python
15
15
```
16
16
17
-
This is a platform wheel built with Rust. If your platform is not already supported,
18
-
see the development section for info on how to build from source.
17
+
This is a platform wheel built with Rust that works on Windows, macOS, and most Linux distributions (using [manylinux](https://github.com/pypa/manylinux)). If you need to run on another platform, see [Development](#development) for information on how to build from source.
19
18
20
-
```
21
19
## Usage
22
20
23
21
### Import
@@ -42,7 +40,7 @@ A media file may contain many manifests in a manifest store. The most recent man
42
40
43
41
If the optional `data_dir` is 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.
44
42
45
-
NOTE: For a comprehensive reference to the JSON manifest structure, see the [CAI manifest store reference](https://contentauth.github.io/json-manifest-reference/manifest-reference).
43
+
NOTE: For a comprehensive reference to the JSON manifest structure, see the [Manifest store reference](https://opensource.contentauthenticity.org/docs/manifest/manifest-ref).
46
44
47
45
### Add a signed manifest to a media file
48
46
@@ -63,7 +61,7 @@ The parameters (in order) are:
63
61
-`sign_info`, a `SignerInfo` object instance; see [Generating SignerInfo](#generating-signerinfo) below.
64
62
-`data_dir` optionally specifies a directory path from which to load resource files referenced in the manifest JSON identifier fields; for example, thumbnails, icons, and manifest data for ingredients.
65
63
66
-
### Create a SignerInfo Instance
64
+
### Create a SignerInfo instance
67
65
68
66
A `SignerInfo` object contains information about a signature. To create an instance of `SignerInfo`, first set up the signer information from the public and private key `.pem` files as follows:
It is best to [set up a virtual environment](https://virtualenv.pypa.io/en/latest/installation.html) for development and testing.
127
+
It is best to [set up a virtual environment](https://virtualenv.pypa.io/en/latest/installation.html) for development and testing. To build from source on Linux, install `curl` and `rustup` then set up Python.
109
128
110
-
To build from source on Linux, install curl and rustup and set up python
129
+
First update `apt` then (if needed) install `curl`:
111
130
112
-
First update apt
113
131
```
114
132
apt update
133
+
apt install curl
115
134
```
116
135
117
-
Install Rust
118
-
```apt install curl
136
+
Install Rust:
137
+
138
+
```
119
139
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
120
140
source "$HOME/.cargo/env"
121
141
```
122
142
123
-
Install Python, pip and venv
143
+
Install Python, `pip`, and `venv`:
144
+
124
145
```
125
146
apt install python3
126
147
apt install pip
127
148
apt install python3.11-venv
128
149
python3 -m venv .venv
129
150
```
130
151
131
-
Build the wheel for your platform
152
+
Build the wheel for your platform:
153
+
132
154
```
133
155
source .venv/bin/activate
134
156
pip install maturin
@@ -140,6 +162,9 @@ python3 -m build --wheel
140
162
```
141
163
142
164
### ManyLinux build
165
+
166
+
Build using [manylinux](https://github.com/pypa/manylinux) by using a Docker image as follows:
167
+
143
168
```
144
169
docker run -it quay.io/pypa/manylinux_2_28_aarch64 bash
145
170
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
There are some breaking changes to align with future APIs:
211
+
This release includes some breaking changes to align with future APIs:
210
212
-`C2paSignerInfo` moves the `alg` to the first parameter from the 3rd.
211
213
-`c2pa.verify_from_file_json` is now `c2pa.read_file`.
212
214
-`c2pa.ingredient_from_file_json` is now `c2pa.read_ingredient_file`.
@@ -217,12 +219,12 @@ There are some breaking changes to align with future APIs:
217
219
218
220
## License
219
221
220
-
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).
222
+
This package is distributed under the terms of both the [MIT license](https://github.com/contentauth/c2pa-python/blob/main/LICENSE-MIT) and the [Apache License (Version 2.0)](https://github.com/contentauth/c2pa-python/blob/main/LICENSE-APACHE).
221
223
222
224
Note that some components and dependent crates are licensed under different terms; please check the license terms for each crate and component for details.
223
225
224
226
### Contributions and feedback
225
227
226
-
We welcome contributions to this project. For information on contributing, providing feedback, and about ongoing work, see [Contributing](https://github.com/contentauth/c2pa-js/blob/main/CONTRIBUTING.md).
228
+
We welcome contributions to this project. For information on contributing, providing feedback, and about ongoing work, see [Contributing](https://github.com/contentauth/c2pa-python/blob/main/CONTRIBUTING.md).
0 commit comments