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
+55-38Lines changed: 55 additions & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,10 +14,16 @@ 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.
18
+
19
+
### Reinstalling
20
+
21
+
If you tried unsuccessfully to install this package before the [0.40 release](https://github.com/contentauth/c2pa-python/releases/tag/v0.4), then use this command to reinstall:
@@ -42,7 +48,7 @@ A media file may contain many manifests in a manifest store. The most recent man
42
48
43
49
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
50
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).
51
+
NOTE: For a comprehensive reference to the JSON manifest structure, see the [Manifest store reference](https://opensource.contentauthenticity.org/docs/manifest/manifest-ref).
46
52
47
53
### Add a signed manifest to a media file
48
54
@@ -63,7 +69,7 @@ The parameters (in order) are:
63
69
-`sign_info`, a `SignerInfo` object instance; see [Generating SignerInfo](#generating-signerinfo) below.
64
70
-`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
71
66
-
### Create a SignerInfo Instance
72
+
### Create a SignerInfo instance
67
73
68
74
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.
135
+
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
136
110
-
To build from source on Linux, install curl and rustup and set up python
137
+
First update `apt` then (if needed) install `curl`:
111
138
112
-
First update apt
113
139
```
114
140
apt update
141
+
apt install curl
115
142
```
116
143
117
-
Install Rust
118
-
```apt install curl
144
+
Install Rust:
145
+
146
+
```
119
147
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
120
148
source "$HOME/.cargo/env"
121
149
```
122
150
123
-
Install Python, pip and venv
151
+
Install Python, `pip`, and `venv`:
152
+
124
153
```
125
154
apt install python3
126
155
apt install pip
127
156
apt install python3.11-venv
128
157
python3 -m venv .venv
129
158
```
130
159
131
-
Build the wheel for your platform
160
+
Build the wheel for your platform:
161
+
132
162
```
133
163
source .venv/bin/activate
134
164
pip install maturin
@@ -140,6 +170,9 @@ python3 -m build --wheel
140
170
```
141
171
142
172
### ManyLinux build
173
+
174
+
Build using [manylinux](https://github.com/pypa/manylinux) by using a Docker image as follows:
175
+
143
176
```
144
177
docker run -it quay.io/pypa/manylinux_2_28_aarch64 bash
145
178
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
- Changes the name of the import from `c2pa-python` to `c2pa`.
222
+
- Supports pre-built platform wheels for macOS, Windows and [manylinux](https://github.com/pypa/manylinux).
205
223
206
-
##Change Notes:
224
+
### Version 0.3.0
207
225
208
-
Version 0.3.0 changes:
209
-
There are some breaking changes to align with future APIs:
226
+
This release includes some breaking changes to align with future APIs:
210
227
-`C2paSignerInfo` moves the `alg` to the first parameter from the 3rd.
211
228
-`c2pa.verify_from_file_json` is now `c2pa.read_file`.
212
229
-`c2pa.ingredient_from_file_json` is now `c2pa.read_ingredient_file`.
@@ -217,12 +234,12 @@ There are some breaking changes to align with future APIs:
217
234
218
235
## License
219
236
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).
237
+
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
238
222
239
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
240
224
241
### Contributions and feedback
225
242
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).
243
+
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