libpng warning: iCCP: Not recognizing known sRGB profile that has beencool editeed

解决cocos2dx在Xcode中运行时报:convert: iCCP: known incorrect sRGB profile 的问题
解决cocos2dx在Xcode中运行时报:convert: iCCP: known incorrect sRGB profile 的问题
本文的实践来源是参照了两个帖子完成的:
http://discuss.cocos2d-x.org/t/cocos2d-x-3-0-and-libpng/12451、
/image/462530.html,
感谢以上作者的分享。。。
以前每次运行cocos2dx 的程序时总是报警告:convert: iCCP: known incorrect sRGB profile,
今天来解决一下。。。
要解决这个问题需要在终端(Mac)运行 ImageMagick的convert命令:
  find . -type f -name "*.png" -exec convert {} -strip {} \;
可是经过若干次尝试发现convert()原来是ImageMagick 中的命令,遂有了下面先安装ImageMagick 的过程。。。
1,先安装ImageMagick 所依赖的库,因为我们的工程中仅仅用到了PNG的图,所以此处就以PNG库为例,其他类似。。。
到 http://www.imagemagick.org/download/delegates/ 下载对应的库,
此处仅下载 libpng-1.6.14.tar.gz 包,然后通过下面的命令安装:
  tar xzvf libpng-1.6.14.tar.gz
  cd libpng-1.6.14
  ./configure
  sudo make install
2,安装ImageMagick,
  curl -O ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
  tar xzvf ImageMagick.tar.gz
  cd ImageMagick-6.7.6-5
  ./configure --prefix=/opt/ImageMagick --enable-share --enable-static LDFLAGS="-L/usr/lib64" CPPFLAGS="-I/usr/include”
  sudo make install
3,验证PNG依赖库有没有安装成功,
  /opt/ImageMagick/bin/convert -list format,
在结果中查找是否含有
PNG*,有的话说明依赖库已经安装成功,否则没有成功,然后回去仔细检查是否按照本教程一步步的安装,亦或是参照上面的两个连接查找原因。。。
4,好了,既然安装好了ImageMagick,那么convert函数便可以用了,在命令行 cd 到自己的工程资源目录,运行下面的 命令来解决上面提到的问题
  find . -type f -name "*.png" -exec /opt/ImageMagick/bin/convert {} -strip {} \;  
5,扩展:当然ImageMagick还有很多其他非常强大 的功能,此处便不意义列举了,想了解的话可以自己去查。。。
如果您想提高自己的技术水平,认识同行朋友、开拓技术视野,请加入QQ群:
Powered by
& 2014 &&&联系本站:T13:09:47Z —
auto p1 = Sprite::create(“Image/testImage/player1.png”); p1 ~~& setAnchorPoint); p1~~& setPosition(Point(600,870)); p1 ~~& setS this~~& addChild(p1);
I add the Sprite. But make a mistake。who can tell me why?
there is error message:
libpng warning: iCCP: known incorrect sRGB profilelibpng error: IDAT: invalid window sizecocos2d: Fails: init fps_imageslibpng warning: iCCP: known incorrect sRGB profilelibpng error: IDAT: invalid window sizePosts - 27,
Articles - 0,
Comments - 8
使用程序创造世界,使用代码创造规则
12:39 by 李馨, ... 阅读,
参考 &&解决I got the following warnings in console when running your app that uses cocos2d-x 3.0convert: iCCP: known incorrect sRGB profile 'flash.png' @ warning/png.c/MagickPNGWarningHandler/1830.If you get similar warnings, try running the following bash commandfind . -type f -name "*.png" -exec convert {} -strip {} \;This will use ImageMagick to strip and fix all png files (usually Photoshop and some other editors create bad iCCP chunks)怎么不报 libpng warning:iCCP:known incorrect sRGB profile_百度知道
怎么不报 libpng warning:iCCP:known incorrect sRGB profile
我有更好的答案
按默认排序
您好该应用为谷歌程序,此问题我们也已经反馈,感谢您的支持。该答案来自魅族MX2官方网站
其他类似问题
iccp的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁Name, Description
Package Base
Exact Name
Exact Package Base
Maintainer
Out of Date
Not Flagged
Maintainer
Sort order
Descending
Package Details: unknown-horizons
Package Actions
Dependencies (5)
Required by (0)
Comment by ChrisOelmueller
New release!
[pkgrel 1] - new release, require fife-git (see below) plus fix for color overlays w/atlases
Comment by ChrisOelmueller
The issue appears to have been introduced with the upgrade to SWIG 3. I personally had not upgraded due to similar issues with SWIG updates in the past and thus been unable to reproduce.
Indeed fife-git has fixed the problem and should work with unknown-horizons-git as you mentioned. I am not sure if the combination (unknown-horizons / fife-git) also works.
If fife-git plays nicely, I'd prefer requiring that over more patching for 0.3.5 myself. If it does not, I could wait for a new FIFE release, which is unlikely to happen soon, or apply your workaround to the package untested.
Comment by bby
Temporary workaround for the issue below:
Comment out (Add a # at the start) the following lines in
/usr/lib/python2.7/site-packages/fife/fife.py
More technically it appears there is some issue in swig passing a bool through an *args array.
unknown-horizons-git (dependent on fife-git) is unaffected.
Comment by balduin
I have downloaded the package and installed, but I got this error message!
unknown-horizons
libpng warning: iCCP: known incorrect sRGB profile
Traceback (most recent call last):
File &/usr/bin/unknown-horizons&, line 473, in &module&
File &/usr/bin/unknown-horizons&, line 283, in main
ret = horizons.main.start(options)
File &/usr/lib/python2.7/site-packages/horizons/main.py&, line 179, in start
horizons.globals.fife.init()
File &/usr/lib/python2.7/site-packages/horizons/engine/engine.py&, line 159, in init
self._setting.apply()
File &/usr/lib/python2.7/site-packages/horizons/engine/settings.py&, line 87, in apply
change_language(language)
File &/usr/lib/python2.7/site-packages/horizons/i18n/__init__.py&, line 125, in change_language
horizons.globals.fife.pychan.loadFonts(fontdef)
File &/usr/lib/python2.7/site-packages/fife/extensions/pychan/fonts.py&, line 88, in loadFonts
for font in Font.loadFromFile(filename):
File &/usr/lib/python2.7/site-packages/fife/extensions/pychan/fonts.py&, line 73, in loadFromFile
fonts.append( Font(name,_get) )
File &/usr/lib/python2.7/site-packages/fife/extensions/pychan/fonts.py&, line 46, in __init__
self.font.setAntiAlias(self.antialias)
File &/usr/lib/python2.7/site-packages/fife/fife.py&, line 3233, in setAntiAlias
return _fife.GuiFont_setAntiAlias(self, *args)
TypeError: in method 'GuiFont_setAntiAlias', argument 2 of type 'bool'
AL lib: (EE) alc_cleanup: 1 device not closed
Comment by ChrisOelmueller
(Sorry again about this prolonged period of silence.)
Were any of you using `fife-svn` or `fife-git` packages to provide fife? (If you're still using the now-deleted `fife-svn`, make sure to upgrade to `fife` sometime.) For now I've added
[pkgrel 6] - an ugly hack to require non-git fife
but still can't reproduce these issues on my system. If nothing else helps, perhaps try `unknown-horizons-git` and `fife` packages.
Comment by pulsar68
Comment by skiwi
I get the same error as tacloban.
Comment by tacloban
maybe I have a font issue?
Comment by tacloban
Tried the latest from AUR, , getting a different error now:
libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
Traceback (most recent call last):
File &/usr/bin/unknown-horizons&, line 473, in &module&
File &/usr/bin/unknown-horizons&, line 283, in main
ret = horizons.main.start(options)
File &/usr/lib/python2.7/site-packages/horizons/main.py&, line 179, in start
horizons.globals.fife.init()
File &/usr/lib/python2.7/site-packages/horizons/engine/engine.py&, line 159, in init
self._setting.apply()
File &/usr/lib/python2.7/site-packages/horizons/engine/settings.py&, line 87, in apply
change_language(language)
File &/usr/lib/python2.7/site-packages/horizons/i18n/__init__.py&, line 125, in change_language
horizons.globals.fife.pychan.loadFonts(fontdef)
File &/usr/lib/python2.7/site-packages/fife/extensions/pychan/fonts.py&, line 88, in loadFonts
for font in Font.loadFromFile(filename):
File &/usr/lib/python2.7/site-packages/fife/extensions/pychan/fonts.py&, line 73, in loadFromFile
fonts.append( Font(name,_get) )
File &/usr/lib/python2.7/site-packages/fife/extensions/pychan/fonts.py&, line 46, in __init__
self.font.setAntiAlias(self.antialias)
File &/usr/lib/python2.7/site-packages/fife/fife.py&, line 3233, in setAntiAlias
return _fife.GuiFont_setAntiAlias(self, *args)
TypeError: in method 'GuiFont_setAntiAlias', argument 2 of type 'bool'
AL lib: (EE) alc_cleanup: 1 device not closed
Comment by ChrisOelmueller
After some debugging and testing in #unknown-horizons:
[pkgrel 5] - patch a couple of lines that might break with fife 0.3.5
Hopefully that fixes the issue reported some weeks ago (sorry about the delay).

我要回帖

更多关于 recognizing 的文章

 

随机推荐