[meta] Metadata: read and strip EXIF/GPS/XMP/IPTC (JPEG, PNG, WebP, GIF, TIFF) and PDF info/XMP

This commit is contained in:
2026-11-16 13:27:47 +01:00
parent 2c1611b34a
commit ede068f7c9
17 changed files with 2914 additions and 88 deletions
+88 -88
View File
@@ -1,88 +1,88 @@
# Dependencies and their licences
Every crate and binary Pictor's core uses, with its licence, recorded **before** it is used.
The brief's rule: only components that need no licence deal — MIT, Apache-2.0, BSD, Zlib, MPL-2.0, or a codec the
OS already provides. Nothing paid, copyleft-to-bundle, patent-encumbered or non-commercial.
## The allowed set, as checked by `scripts/deps.mjs`
| Licence (SPDX) | Why it is allowed |
| :-- | :-- |
| MIT, MIT-0 | named in the brief |
| Apache-2.0, Apache-2.0 WITH LLVM-exception | named in the brief |
| BSD-2-Clause, BSD-3-Clause, 0BSD | named in the brief ("BSD") |
| Zlib | named in the brief |
| MPL-2.0 | named in the brief (file-level copyleft: our own changes to such files stay MPL, which suits this repo) |
| ISC | **interpretation, Mark to confirm**: the BSD-style licence of the ISC; OSI calls it functionally the simplified BSD licence |
| Unicode-3.0, Unicode-DFS-2016 | **interpretation, Mark to confirm**: the MIT-style licence of Unicode's data tables; every Rust program that parses identifiers or text pulls it in (`unicode-ident`) |
| BSL-1.0, CC0-1.0 | **interpretation, Mark to confirm**: Boost (MIT-like, no attribution in binaries) and public domain |
An SPDX expression with `OR` passes when one branch passes; `AND` needs every part to pass. Anything else makes the
script exit 1, and the feature that needs it waits (the brief: "it never gets a fallback").
## Direct dependencies
| Crate | Version | Licence | Used by | For |
| :-- | :-- | :-- | :-- | :-- |
| thiserror | 2 | MIT OR Apache-2.0 | all | error types |
| serde, serde_json | 1 | MIT OR Apache-2.0 | worker, pdf, meta, qr | the worker protocol, reports |
| base64 | 0.22 | MIT OR Apache-2.0 | worker | binary payloads in the protocol |
| image | 0.25 | MIT OR Apache-2.0 | raster, pdf, qr | PNG, JPG, WebP, BMP, GIF, TIFF, ICO decode/encode (no default features: only these codecs) |
| kamadak-exif | 0.6 | BSD-2-Clause | meta | reading EXIF (and writing EXIF fixtures in tests) |
| img-parts | 0.4 | MIT OR Apache-2.0 | meta | JPEG segments, PNG and WebP chunks, without re-encoding |
| qrcode | 0.14 | MIT OR Apache-2.0 | qr | QR matrix and SVG |
| lopdf | 0.47 | MIT | pdf, meta | PDF structure: annotations, stamps, the redaction rebuild, encryption, metadata |
| pdfium-render | 0.9.5 | MIT OR Apache-2.0 | pdf | bindings to pdfium (render, text, forms, pages) |
| tempfile | 3 | MIT OR Apache-2.0 | save (and tests) | temporary files next to the target |
| sha2 | 0.11 | MIT OR Apache-2.0 | worker, tests | hashes for fixtures and the fetch scripts' self-check |
| getrandom | 0.4 | MIT OR Apache-2.0 | pdf | the OS random generator, for the AES-256 file key of a password-protected PDF |
| flate2 | 1 (dev) | MIT OR Apache-2.0 | pdf tests | building compressed hostile fixtures (a deflate bomb) |
| windows | 0.62 | MIT OR Apache-2.0 | raster (Windows only), worker | WIC (HEIC), Job Objects |
| rqrr | 0.11 (dev) | (MIT OR Apache-2.0) AND ISC | qr tests | decoding generated codes back (ISC: see above) |
| proptest | 1 (dev) | MIT OR Apache-2.0 | tests | property tests |
## Binaries (fetched, never in git)
| Binary | Licence | Fetched by |
| :-- | :-- | :-- |
| pdfium (bblanchon/pdfium-binaries, Windows x64) | see "pdfium" below | `scripts/fetch-pdfium.ps1`, sha256-pinned |
### pdfium
Release `chromium/8125` (PDFium 158.0.8125.0), `pdfium-win-x64.tgz`, sha256
`9a964261760cff52570aabf038ab346d3a5034dd8b30d0d5fe8861235d356b8b`, built without V8 and XFA (`args.gn`). It matches
pdfium-render 0.9.5's `pdfium_latest` (= `pdfium_8125`). The archive's `LICENSE` and `licenses/` folder ship beside
the dll (the app's installer copies them). Read from those files on 2026-11-16:
| Component inside pdfium.dll | Licence | In the allowed set? |
| :-- | :-- | :-- |
| the binary build (bblanchon/pdfium-binaries) | MIT | yes |
| PDFium | BSD-3-Clause (+ Apache-2.0 parts) | yes |
| abseil, highway | Apache-2.0 | yes |
| llvm-libc, dragonbox | Apache-2.0 WITH LLVM-exception (dragonbox also BSL-1.0) | yes |
| fast_float, simdutf | MIT | yes |
| lcms2, agg 2.3 | MIT-style permission notice | yes (MIT family) |
| OpenJPEG | BSD-2-Clause | yes |
| zlib | Zlib | yes |
| HarfBuzz | "Old MIT" | yes (MIT family) |
| ICU | Unicode-3.0 | **interpretation** (see above) |
| libpng | PNG Reference Library License v2 (Libpng-2.0, zlib-style) | **interpretation**: zlib-style permissive |
| libjpeg-turbo | IJG + BSD-3-Clause | **interpretation**: IJG is BSD-style (credit in documentation) |
| FreeType | The FreeType Project License (FTL; dual with GPL-2.0, we take FTL) | **interpretation**: BSD-style with a credit clause — the app's About box says "Portions of this software are copyright © The FreeType Project (www.freetype.org). All rights reserved." |
None of these needs a licence deal, is paid, copyleft-to-bundle, patent-encumbered or non-commercial. The four marked
"interpretation" are not named in the brief's list; they are BSD/zlib-style, and **Mark should confirm** them (PDF
support depends on pdfium, which the brief chose).
## OS codecs (not bundled)
| Codec | Provided by | Used for |
| :-- | :-- | :-- |
| HEIF/HEIC through WIC | Windows (HEIF Image Extensions + an HEVC decoder from the Microsoft Store) | decoding iPhone photos; never bundled |
## Every crate in Cargo.lock
Generated by `node scripts/deps.mjs` from `cargo metadata`; do not edit by hand.
<!-- deps:begin -->
<!-- deps:end -->
# Dependencies and their licences
Every crate and binary Pictor's core uses, with its licence, recorded **before** it is used.
The brief's rule: only components that need no licence deal — MIT, Apache-2.0, BSD, Zlib, MPL-2.0, or a codec the
OS already provides. Nothing paid, copyleft-to-bundle, patent-encumbered or non-commercial.
## The allowed set, as checked by `scripts/deps.mjs`
| Licence (SPDX) | Why it is allowed |
| :-- | :-- |
| MIT, MIT-0 | named in the brief |
| Apache-2.0, Apache-2.0 WITH LLVM-exception | named in the brief |
| BSD-2-Clause, BSD-3-Clause, 0BSD | named in the brief ("BSD") |
| Zlib | named in the brief |
| MPL-2.0 | named in the brief (file-level copyleft: our own changes to such files stay MPL, which suits this repo) |
| ISC | **interpretation, Mark to confirm**: the BSD-style licence of the ISC; OSI calls it functionally the simplified BSD licence |
| Unicode-3.0, Unicode-DFS-2016 | **interpretation, Mark to confirm**: the MIT-style licence of Unicode's data tables; every Rust program that parses identifiers or text pulls it in (`unicode-ident`) |
| BSL-1.0, CC0-1.0 | **interpretation, Mark to confirm**: Boost (MIT-like, no attribution in binaries) and public domain |
An SPDX expression with `OR` passes when one branch passes; `AND` needs every part to pass. Anything else makes the
script exit 1, and the feature that needs it waits (the brief: "it never gets a fallback").
## Direct dependencies
| Crate | Version | Licence | Used by | For |
| :-- | :-- | :-- | :-- | :-- |
| thiserror | 2 | MIT OR Apache-2.0 | all | error types |
| serde, serde_json | 1 | MIT OR Apache-2.0 | worker, pdf, meta, qr | the worker protocol, reports |
| base64 | 0.22 | MIT OR Apache-2.0 | worker | binary payloads in the protocol |
| image | 0.25 | MIT OR Apache-2.0 | raster, pdf, qr | PNG, JPG, WebP, BMP, GIF, TIFF, ICO decode/encode (no default features: only these codecs) |
| kamadak-exif | 0.6 | BSD-2-Clause | meta | reading EXIF (and writing EXIF fixtures in tests) |
| img-parts | 0.4 (dev) | MIT OR Apache-2.0 | meta tests | building PNG and WebP fixtures (meta walks the containers with its own bounds-checked parsers) |
| qrcode | 0.14 | MIT OR Apache-2.0 | qr | QR matrix and SVG |
| lopdf | 0.47 | MIT | pdf, meta | PDF structure: annotations, stamps, the redaction rebuild, encryption, metadata |
| pdfium-render | 0.9.5 | MIT OR Apache-2.0 | pdf | bindings to pdfium (render, text, forms, pages) |
| tempfile | 3 | MIT OR Apache-2.0 | save (and tests) | temporary files next to the target |
| sha2 | 0.11 | MIT OR Apache-2.0 | worker, tests | hashes for fixtures and the fetch scripts' self-check |
| getrandom | 0.4 | MIT OR Apache-2.0 | pdf | the OS random generator, for the AES-256 file key of a password-protected PDF |
| flate2 | 1 (dev) | MIT OR Apache-2.0 | pdf tests | building compressed hostile fixtures (a deflate bomb) |
| windows | 0.62 | MIT OR Apache-2.0 | raster (Windows only), worker | WIC (HEIC), Job Objects |
| rqrr | 0.11 (dev) | (MIT OR Apache-2.0) AND ISC | qr tests | decoding generated codes back (ISC: see above) |
| proptest | 1 (dev) | MIT OR Apache-2.0 | tests | property tests |
## Binaries (fetched, never in git)
| Binary | Licence | Fetched by |
| :-- | :-- | :-- |
| pdfium (bblanchon/pdfium-binaries, Windows x64) | see "pdfium" below | `scripts/fetch-pdfium.ps1`, sha256-pinned |
### pdfium
Release `chromium/8125` (PDFium 158.0.8125.0), `pdfium-win-x64.tgz`, sha256
`9a964261760cff52570aabf038ab346d3a5034dd8b30d0d5fe8861235d356b8b`, built without V8 and XFA (`args.gn`). It matches
pdfium-render 0.9.5's `pdfium_latest` (= `pdfium_8125`). The archive's `LICENSE` and `licenses/` folder ship beside
the dll (the app's installer copies them). Read from those files on 2026-11-16:
| Component inside pdfium.dll | Licence | In the allowed set? |
| :-- | :-- | :-- |
| the binary build (bblanchon/pdfium-binaries) | MIT | yes |
| PDFium | BSD-3-Clause (+ Apache-2.0 parts) | yes |
| abseil, highway | Apache-2.0 | yes |
| llvm-libc, dragonbox | Apache-2.0 WITH LLVM-exception (dragonbox also BSL-1.0) | yes |
| fast_float, simdutf | MIT | yes |
| lcms2, agg 2.3 | MIT-style permission notice | yes (MIT family) |
| OpenJPEG | BSD-2-Clause | yes |
| zlib | Zlib | yes |
| HarfBuzz | "Old MIT" | yes (MIT family) |
| ICU | Unicode-3.0 | **interpretation** (see above) |
| libpng | PNG Reference Library License v2 (Libpng-2.0, zlib-style) | **interpretation**: zlib-style permissive |
| libjpeg-turbo | IJG + BSD-3-Clause | **interpretation**: IJG is BSD-style (credit in documentation) |
| FreeType | The FreeType Project License (FTL; dual with GPL-2.0, we take FTL) | **interpretation**: BSD-style with a credit clause — the app's About box says "Portions of this software are copyright © The FreeType Project (www.freetype.org). All rights reserved." |
None of these needs a licence deal, is paid, copyleft-to-bundle, patent-encumbered or non-commercial. The four marked
"interpretation" are not named in the brief's list; they are BSD/zlib-style, and **Mark should confirm** them (PDF
support depends on pdfium, which the brief chose).
## OS codecs (not bundled)
| Codec | Provided by | Used for |
| :-- | :-- | :-- |
| HEIF/HEIC through WIC | Windows (HEIF Image Extensions + an HEVC decoder from the Microsoft Store) | decoding iPhone photos; never bundled |
## Every crate in Cargo.lock
Generated by `node scripts/deps.mjs` from `cargo metadata`; do not edit by hand.
<!-- deps:begin -->
<!-- deps:end -->