Skip to content

Commit 2304265

Browse files
authored
Merge pull request #10 from contentauth/manylinux-doc-update
README cleanup... Landing since this is doc-only and mostly just cleanup.
2 parents ba80c16 + d9ee1ce commit 2304265

File tree

1 file changed

+55
-38
lines changed

1 file changed

+55
-38
lines changed

README.md

Lines changed: 55 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,16 @@ Install from PyPI by entering this command:
1414
pip install -U c2pa-python
1515
```
1616

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:
1922

2023
```
24+
pip install --upgrade --force-reinstall c2pa-python
25+
```
26+
2127
## Usage
2228

2329
### Import
@@ -42,7 +48,7 @@ A media file may contain many manifests in a manifest store. The most recent man
4248

4349
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.
4450

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).
4652

4753
### Add a signed manifest to a media file
4854

@@ -63,7 +69,7 @@ The parameters (in order) are:
6369
- `sign_info`, a `SignerInfo` object instance; see [Generating SignerInfo](#generating-signerinfo) below.
6470
- `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.
6571

66-
### Create a SignerInfo Instance
72+
### Create a SignerInfo instance
6773

6874
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:
6975

@@ -103,32 +109,56 @@ manifest_json = json.dumps({
103109
})
104110
```
105111

112+
## Supported file formats
113+
114+
| Extensions | MIME type |
115+
| ------------- | --------------------------------------------------- |
116+
| `avi` | `video/msvideo`, `video/avi`, `application-msvideo` |
117+
| `avif` | `image/avif` |
118+
| `c2pa` | `application/x-c2pa-manifest-store` |
119+
| `dng` | `image/x-adobe-dng` |
120+
| `heic` | `image/heic` |
121+
| `heif` | `image/heif` |
122+
| `jpg`, `jpeg` | `image/jpeg` |
123+
| `m4a` | `audio/mp4` |
124+
| `mp4` | `video/mp4`, `application/mp4` |
125+
| `mov` | `video/quicktime` |
126+
| `png` | `image/png` |
127+
| `svg` | `image/svg+xml` |
128+
| `tif`,`tiff` | `image/tiff` |
129+
| `wav` | `audio/x-wav` |
130+
| `webp` | `image/webp` |
131+
132+
106133
## Development
107134

108-
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.
109136

110-
To build from source on Linux, install curl and rustup and set up python
137+
First update `apt` then (if needed) install `curl`:
111138

112-
First update apt
113139
```
114140
apt update
141+
apt install curl
115142
```
116143

117-
Install Rust
118-
```apt install curl
144+
Install Rust:
145+
146+
```
119147
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
120148
source "$HOME/.cargo/env"
121149
```
122150

123-
Install Python, pip and venv
151+
Install Python, `pip`, and `venv`:
152+
124153
```
125154
apt install python3
126155
apt install pip
127156
apt install python3.11-venv
128157
python3 -m venv .venv
129158
```
130159

131-
Build the wheel for your platform
160+
Build the wheel for your platform:
161+
132162
```
133163
source .venv/bin/activate
134164
pip install maturin
@@ -140,6 +170,9 @@ python3 -m build --wheel
140170
```
141171

142172
### ManyLinux build
173+
174+
Build using [manylinux](https://github.com/pypa/manylinux) by using a Docker image as follows:
175+
143176
```
144177
docker run -it quay.io/pypa/manylinux_2_28_aarch64 bash
145178
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
@@ -155,7 +188,6 @@ git clone https://github.com/contentauth/c2pa-python.git
155188
cd c2pa-python
156189
python3 -m build --wheel
157190
auditwheel repair target/wheels/c2pa_python-0.4.0-py3-none-linux_aarch64.whl
158-
159191
```
160192

161193
### Testing
@@ -171,9 +203,7 @@ pytest
171203
deactivate
172204
```
173205

174-
### Example
175-
176-
Run the example code like this:
206+
For example:
177207

178208
```
179209
source .venv/bin/activate
@@ -182,31 +212,18 @@ python3 tests/training.py
182212
deactivate
183213
```
184214

185-
## Supported file formats
215+
## Release notes
186216

187-
| Extensions | MIME type |
188-
| ------------- | --------------------------------------------------- |
189-
| `avi` | `video/msvideo`, `video/avi`, `application-msvideo` |
190-
| `avif` | `image/avif` |
191-
| `c2pa` | `application/x-c2pa-manifest-store` |
192-
| `dng` | `image/x-adobe-dng` |
193-
| `heic` | `image/heic` |
194-
| `heif` | `image/heif` |
195-
| `jpg`, `jpeg` | `image/jpeg` |
196-
| `m4a` | `audio/mp4` |
197-
| `mp4` | `video/mp4`, `application/mp4` |
198-
| `mov` | `video/quicktime` |
199-
| `png` | `image/png` |
200-
| `svg` | `image/svg+xml` |
201-
| `tif`,`tiff` | `image/tiff` |
202-
| `wav` | `audio/x-wav` |
203-
| `webp` | `image/webp` |
217+
### Version 0.4.0
218+
219+
This release:
204220

221+
- 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).
205223

206-
## Change Notes:
224+
### Version 0.3.0
207225

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:
210227
- `C2paSignerInfo` moves the `alg` to the first parameter from the 3rd.
211228
- `c2pa.verify_from_file_json` is now `c2pa.read_file`.
212229
- `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:
217234

218235
## License
219236

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).
221238

222239
Note that some components and dependent crates are licensed under different terms; please check the license terms for each crate and component for details.
223240

224241
### Contributions and feedback
225242

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).
227244

228245

0 commit comments

Comments
 (0)