# [Bug] dsh web 启动时反复打印 libpng warning: iCCP: known incorrect sRGB profile ——资源扫描范围疑似过宽
#5075
Replies: 2 comments 1 reply
Separate the observed warning from the unverified scan-boundary hypothesisThe report establishes a repeatable native A low-cost isolation matrix would be: built-in web profile with no community plugins; the same profile with Preferred remediation boundaryIf the attribution is confirmed, make startup consume declared runtime assets (for example Regression evidence1. A clean built-in profile emits no iCCP warning. The proposed directory exclusions are therefore a good fix candidate, but the isolation matrix should land first as evidence that the scanner—not another native dependency—is the owner of the noise. |
|
源码核对(0.1.2-alpha.1,cd5ef81481;OP 在 rc.2,若 rc.2 有差异以实际版本为准,但以下两个核心事实与版本无关):"dsh web 启动时扫描插件目录资源并解码 PNG"这个根因假设,在 alpha.1 树内得不到支持,且有一个文件位置直接否证了"dsh 是打开者"。 树内事实:
决定性反证(与版本无关):第 10 个文件是 最可能的打开者:10 个文件中 9 个在第三方插件 判别实验(比矩阵更省事的决定性两步):
另:OP 已验证"剥离 iCCP 块后警告消失",这本身是好的缓解手段,但若根因在第三方插件,插件升级会带回原图(OP 已预见)。把判别实验做完再决定修哪一侧,避免在 dsh core 上为第三方插件的行为打补丁。 |
Uh oh!
There was an error while loading. Please reload this page.
环境
现象
每次执行
dsh web启动,控制台(PowerShell)会连续输出 50+ 行:警告在服务启动阶段即出现,无需任何用户交互;每次启动都稳定复现。
根因分析
我扫描了 dsh 相关的 94 个 PNG 文件(profile 的 node_modules + 全局 npm node_modules),其中 10 个带有 iCCP 块:
dsh-memory-evolve/docs/images/(该插件 README 的文档截图,属于文档资源,非运行时资源)。它们的 ICC profile 完全相同:MD59fe903287f51bd969426c28888c19682、3348 字节、profile 名为 "ICC Profile",即 Chromium/Google 旧工具分发的经典"已知错误 sRGB 档案"。npm/node_modules/npm/node_modules/qrcode-terminal/example/basic.png(同样是示例资源)。推测:
dsh web启动阶段会对插件目录做资源扫描(建索引 / 缩略图 / 打包),扫描范围把docs/、example/这类非运行时目录也一并卷入,并对每张 PNG 反复解码 5 次以上,于是同一批坏图产生了 50+ 行警告。该根因为基于现象的合理推测,未直接读到 dsh web 源码中的扫描代码,烦请维护者确认。影响
复现步骤
dsh-memory-evolve(其docs/images/下自带 9 张带 iCCP 的截图);dsh web;建议(任选或组合)
docs/、example/、test/等非运行时目录,只扫描真正的运行时资源目录(如lib/、assets/、icons/)。PNG_SET_OPTION_STRIP_iCCP,让这类无害的 profile 警告不落到 stderr。本地临时规避
剥离这 10 个 PNG 的 iCCP 块后重启 dsh web,警告完全消失(已验证)。但插件升级会带回带 iCCP 的原图,因此仍需上游修复。
感谢维护,期待反馈!
All reactions