chore: 屏蔽 "libpng warning: iCCP: known incorrect sRGB profile" 警告 #158
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
加载 PNG 图片时很可能会在控制台中弹出大批量的 "libpng warning: iCCP: known incorrect sRGB profile" 警告,十分影响控制条输入输出、调试和阅读。
各个浏览器、图像软件的做法一般都是直接忽略颜色空间信息以 sRGB 颜色空间进行显示。
图像软件在保存时,有时会嵌入颜色空间信息,一般都是各自默认的颜色空间,这些颜色空间其实都是 sRGB。作为专业的图像处理软件,肯定考虑到了 PNG 图像在各个软件中显示的问题。由图像软件生成的图像有很大的可能会在这个图像软件上再次编辑,这个颜色空间在该软件中就是最正确的,没必要让用户进行修改,否则图像软件可能还会提示让用户转换回该软件默认的颜色空间。
根据官方手册中提供的方法 (libpng-manual) 进行屏蔽。