Skip to content

Commit fc871cd

Browse files
author
Rand McKinney
committed
README cleanup
1 parent ba80c16 commit fc871cd

File tree

1 file changed

+43
-41
lines changed

1 file changed

+43
-41
lines changed

README.md

Lines changed: 43 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@ 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.
1918

20-
```
2119
## Usage
2220

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

4341
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.
4442

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

4745
### Add a signed manifest to a media file
4846

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

66-
### Create a SignerInfo Instance
64+
### Create a SignerInfo instance
6765

6866
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:
6967

@@ -103,32 +101,56 @@ manifest_json = json.dumps({
103101
})
104102
```
105103

104+
## Supported file formats
105+
106+
| Extensions | MIME type |
107+
| ------------- | --------------------------------------------------- |
108+
| `avi` | `video/msvideo`, `video/avi`, `application-msvideo` |
109+
| `avif` | `image/avif` |
110+
| `c2pa` | `application/x-c2pa-manifest-store` |
111+
| `dng` | `image/x-adobe-dng` |
112+
| `heic` | `image/heic` |
113+
| `heif` | `image/heif` |
114+
| `jpg`, `jpeg` | `image/jpeg` |
115+
| `m4a` | `audio/mp4` |
116+
| `mp4` | `video/mp4`, `application/mp4` |
117+
| `mov` | `video/quicktime` |
118+
| `png` | `image/png` |
119+
| `svg` | `image/svg+xml` |
120+
| `tif`,`tiff` | `image/tiff` |
121+
| `wav` | `audio/x-wav` |
122+
| `webp` | `image/webp` |
123+
124+
106125
## Development
107126

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

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

112-
First update apt
113131
```
114132
apt update
133+
apt install curl
115134
```
116135

117-
Install Rust
118-
```apt install curl
136+
Install Rust:
137+
138+
```
119139
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
120140
source "$HOME/.cargo/env"
121141
```
122142

123-
Install Python, pip and venv
143+
Install Python, `pip`, and `venv`:
144+
124145
```
125146
apt install python3
126147
apt install pip
127148
apt install python3.11-venv
128149
python3 -m venv .venv
129150
```
130151

131-
Build the wheel for your platform
152+
Build the wheel for your platform:
153+
132154
```
133155
source .venv/bin/activate
134156
pip install maturin
@@ -140,6 +162,9 @@ python3 -m build --wheel
140162
```
141163

142164
### ManyLinux build
165+
166+
Build using [manylinux](https://github.com/pypa/manylinux) by using a Docker image as follows:
167+
143168
```
144169
docker run -it quay.io/pypa/manylinux_2_28_aarch64 bash
145170
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
@@ -155,7 +180,6 @@ git clone https://github.com/contentauth/c2pa-python.git
155180
cd c2pa-python
156181
python3 -m build --wheel
157182
auditwheel repair target/wheels/c2pa_python-0.4.0-py3-none-linux_aarch64.whl
158-
159183
```
160184

161185
### Testing
@@ -171,9 +195,7 @@ pytest
171195
deactivate
172196
```
173197

174-
### Example
175-
176-
Run the example code like this:
198+
For example:
177199

178200
```
179201
source .venv/bin/activate
@@ -182,31 +204,11 @@ python3 tests/training.py
182204
deactivate
183205
```
184206

185-
## Supported file formats
186-
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` |
204-
207+
## Release notes
205208

206-
## Change Notes:
209+
### Version 0.3.0
207210

208-
Version 0.3.0 changes:
209-
There are some breaking changes to align with future APIs:
211+
This release includes some breaking changes to align with future APIs:
210212
- `C2paSignerInfo` moves the `alg` to the first parameter from the 3rd.
211213
- `c2pa.verify_from_file_json` is now `c2pa.read_file`.
212214
- `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:
217219

218220
## License
219221

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

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

224226
### Contributions and feedback
225227

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

228230

0 commit comments

Comments
 (0)