feat(palette-extract): 图片解码适配层(D40 第 2 层,唯一引入 image 的地方)
- 新 crate unlucky-palette-extract:路径/字节 → RGBA → design 的种子 - image 只开 png + jpeg(关 default-features,不拖 rayon/avif/webp) - 解码前按 Limits 拒超大尺寸(解压炸弹),解码后最长边缩到 256 - input(&Result<Rgba8, _>) 把失败翻成 ImageInput::Undecodable(回落链靠它区分「没设」与「坏了」) - 11 个单测覆盖纯色/JPEG/抄错扩展名/垃圾字节/截断/缺文件/1px/灰图/大图/超限/零拷贝
This commit is contained in:
1 parent
18327fb038
commit
1aac62f6f0
5 files changed
+410
No files matched your search
@@ -12,6 +12,9 @@ members = [
|
||||
# P4(D26 iced 重写)第一步:与 Slint 版 `crates/app` 并存的新 UI crate。
|
||||
# bin 名 `unlucky-launcher-iced`,翻牌时才改名(见 DevDocs/SubAgentsTalk/app-iced-骨架与翻牌.md)。
|
||||
"crates/app-iced",
|
||||
# M87(D40 第 2 层):配色取色的解码适配层。**唯一**允许引入 `image` 类依赖的地方,
|
||||
# 使 `crates/design` 能继续宣称「零第三方依赖」。
|
||||
"crates/palette-extract",
|
||||
]
|
||||
|
||||
[workspace.package]
|
||||
@@ -61,6 +64,10 @@ zip = { version = "9", default-features = false, features = ["deflate-flate2-zli
|
||||
flate2 = "1"
|
||||
tar = "0.4"
|
||||
|
||||
# M87(D40):配色取色的解码适配层。版本与 `crates/app-iced` 的截图通道对齐(同一份
|
||||
# `image` 只编译一次);编解码器由各 crate 自己按需开 feature,这里只钉版本。
|
||||
image = { version = "0.25", default-features = false }
|
||||
|
||||
# UI 层唯一入口(D2:Slint,RF 2.0 轨道)。
|
||||
# 默认特性已含 backend-default + renderer-femtovg(GL)+ renderer-software(CPU 软渲染兜底,
|
||||
# Win7 老机无可用 GPU 时的降级路径,见 DevDocs/PlanDoc/01c-native-gui-options.md §6)。
|
||||
|
||||
Reference in new issue
Block a user