# QFmt 第三方组件

发行包必须包含各项目的完整许可证文本。本清单记录当前 MVP 构建使用
的组件；正式发布脚本应对实际二进制版本和 SHA-256 再次核验。

## JPEG XL Project

- 工具：`cjpegli`、`cjxl`、`djxl`、`jxlinfo`
- 版本：libjxl 0.12.0
- 上游：https://github.com/libjxl/libjxl
- 许可证：BSD-3-Clause

## libwebp

- 工具：`cwebp`、`dwebp`、`img2webp`、`webpinfo`
- 版本：1.6.0
- 上游：https://chromium.googlesource.com/webm/libwebp
- 许可证：BSD-3-Clause

## oxipng

- 工具：`oxipng`
- 版本：10.1.1
- 上游：https://github.com/shssoichiro/oxipng
- 许可证：MIT

## pngquant

- 工具：`pngquant`；`qfmt-png` 静态使用同源颜色量化引擎
- 版本：3.0.3
- 上游：https://github.com/kornelski/pngquant
- 许可证：GPL-3.0-or-later 或上游商业许可

## libimagequant

- 用途：`qfmt-png` 的颜色量化与 0–100% 抖动实现
- 版本：4.0.3
- 上游：https://github.com/ImageOptim/libimagequant
- 许可证：GPL-3.0-or-later 或上游商业许可

## libpng

- 用途：`qfmt-png` 读写调色板、透明度与色彩信息
- 上游：https://libpng.org/pub/png/libpng.html
- 许可证：Libpng

## gifsicle

- 工具：`gifsicle`
- 版本：1.96
- 上游：https://www.lcdf.org/gifsicle/
- 许可证：GPL-2.0-only
- 完整许可证：`licenses/gifsicle/COPYING`

## libvips

- 工具：`vips`，附带 `vps` 兼容别名
- 版本：8.18.5
- 上游：https://github.com/libvips/libvips
- 许可证：LGPL-2.1-or-later
- 完整许可证：`licenses/libvips/LICENSE`

## FFmpeg 与 Homebrew 动态依赖

- 工具：`ffmpeg`、`ffprobe`
- 当前开发版本：8.1.2
- 上游：https://ffmpeg.org
- 当前 Homebrew 构建启用了 GPL 组件，发行物按 GPLv3 兼容方式分发。
- 构建参数：`--enable-shared --enable-version3 --enable-gpl
  --enable-libsvtav1 --enable-libopus --enable-libx264 --enable-libmp3lame
  --enable-libdav1d --enable-libvmaf --enable-libvpx --enable-libx265
  --enable-openssl --enable-videotoolbox --enable-audiotoolbox --enable-neon`

当前依赖闭包包括 FFmpeg 的 avcodec、avdevice、avfilter、avformat、
avutil、swresample、swscale，以及 SVT-AV1（BSD-3-Clause）、dav1d
（BSD-2-Clause）、LAME（LGPL-2.0-or-later）、Opus（BSD-3-Clause）、
OpenSSL（Apache-2.0）、libvmaf（BSD-2-Clause）、libvpx（BSD-3-Clause）、
x264（GPL-2.0-or-later）和 x265（GPL-2.0）。构建时会根据实际复制的
依赖闭包生成 `ThirdPartyManifest.json`，逐文件记录来源分类与 SHA-256。

JPEG/JXL 工具的动态依赖闭包还包含 giflib（MIT）、libjpeg-turbo
（BSD-3-Clause）、libpng（Libpng）、OpenEXR（BSD-3-Clause）和 Imath
（BSD-3-Clause）。构建脚本会递归复制并改写所有 Homebrew 路径，发布
门禁要求 App 内任一 Mach-O 都不得继续引用 `/opt/homebrew`。


## woff2-encoder

- 用途：通过内嵌 Google WOFF2 WebAssembly 实现 TTF/OTF 与 WOFF2 无损压缩和解压。
- 版本：2.0.0
- 上游：https://github.com/itskyedo/woff2-encoder
- 许可证：MIT
- 完整许可证：`licenses/woff2-encoder/LICENSE`

## resvg-js

- 用途：解析 SVG 画布，并将 SVG 输入栅格化为现有图片编码链使用的 PNG。
- 版本：2.6.2
- 上游：https://github.com/thx/resvg-js
- 许可证：MPL-2.0
- 完整许可证：`licenses/resvg-js/LICENSE`

## SVGO

- 用途：多轮优化并压缩 SVG 标记、样式和路径。
- 版本：4.0.1
- 上游：https://github.com/svg/svgo
- 许可证：MIT
- 完整许可证：`licenses/svgo/LICENSE`

## @storyteller-platform/epub

- 用途：创建、解析、修改并重新保存 EPUB 3；TmpFsAdapter 用于安全解包与重新打包。
- 版本：0.7.0
- 上游：https://github.com/storyteller-platform/epub
- 许可证：MIT

## markdown-it

- 用途：将 Markdown 文本渲染为 EPUB XHTML 章节。
- 版本：14.1.0
- 上游：https://github.com/markdown-it/markdown-it
- 许可证：MIT

## PDFKit

- 用途：在 Bun Helper 中生成 PDF 文档与矢量内容流。
- 版本：0.19.1
- 上游：https://github.com/foliojs/pdfkit
- 许可证：MIT
- 完整许可证：`licenses/pdfkit/LICENSE`

## fontkit

- 用途：解析 SVG 声明的本机字体与 `@font-face` 嵌入字体，以正确选择 PDF 字体。
- 版本：2.0.4
- 上游：https://github.com/foliojs/fontkit
- 许可证：MIT

## SVG-to-PDFKit

- 用途：将 SVG 路径、形状、渐变和文字直接写入 PDFKit 文档。
- 版本：0.1.8
- 上游：https://github.com/alafr/SVG-to-PDFKit
- 许可证：MIT
- 完整许可证：`licenses/svg-to-pdfkit/LICENSE`

## Sparkle

- 版本：2.6 或更高的兼容版本
- 上游：https://github.com/sparkle-project/Sparkle
- 许可证：MIT

## QRls

- 用途：发行时生成下载清单并同步 R2/GitHub；不嵌入 App
- 上游：https://github.com/qzrzz/QRls
- 许可证：以 QRls 仓库登记为准

## remove-ai-watermarks Go

- 工具：`aiwm`
- 版本：v0.43.0-4-g2e26df1-qfmt.1（上游 2e26df1）
- 修改：QFmt 增加 `--provenance-source`，从原图读取来源元数据。
- 上游：https://github.com/wiltodelta/remove-ai-watermarks
- 许可证：Apache-2.0
- 完整许可证：`licenses/aiwm/LICENSE`

## automosaic 自动马赛克

敏感区域识别使用本地 Go automosaic 工具及 YOLO + SAM ONNX
模型，ONNX Runtime 版本为 1.23.2。工具来自用户提供的自动打码
工具项目，参考 anr_plugin_auto_mosaics。

App 的 `Resources/Encoders/automosaic/` 包含对应 Go 源代码、
GPL-3.0-or-later 许可、第三方许可和模型来源。权重单独分发，
签名清单保留每个文件及分片的完整 SHA-256 摘要。
具体组件来源见该目录的 `THIRD_PARTY.md` 与 `third_party/licenses/`。
