libpng 警告:在 Python/PyGame 中使用 png_read_image 时应打开隔行处理

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12990602/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-18 12:20:53  来源:igfitidea点击:

libpng warning: interlace handling should be turned on when using png_read_image in Python/PyGame

pythonpython-3.xpygamelibpng

提问by Julian Laval

I'm using PyGame for Python, and have been receiving the following warning when loading .png images with pygame.image.load:

我正在使用 PyGame for Python,并且在加载 .png 图像时收到以下警告pygame.image.load

libpng warning: Interlace handling should be turned on when using png_read_image

It doesn't affect the program, but has become particularly annoying. I've scoured the web for an answer to no avail.

它不会影响程序,但变得特别烦人。我已经在网上搜索了无济于事的答案。

I'm currently using 32 bit Python 3.3 with PyGame 1.9.2

我目前正在使用 32 位 Python 3.3 和 PyGame 1.9.2

Any ideas as to how I can get the warning to disappear?

关于如何让警告消失的任何想法?

采纳答案by JirkaV

I had the same problem. It seems to be some bug of older libpng versions (see http://sourceforge.net/p/libpng/bugs/165/for detail).

我有同样的问题。这似乎是旧 libpng 版本的一些错误(有关详细信息,请参阅http://sourceforge.net/p/libpng/bugs/165/)。

It should be already fixed, but not in my current setup: win32 + python 2.7.3.

它应该已经修复了,但不是在我当前的设置中:win32 + python 2.7.3。

As a workaround I simply converted png-24 images to png-8 in Photoshop and message has disappeared.

作为一种解决方法,我只是在 Photoshop 中将 png-24 图像转换为 png-8 并且消息消失了。

回答by user2113

I can confirm that I was having this same issue using Pygame 1.9.6 with Python 3.7.4.

我可以确认我在使用 Pygame 1.9.6 和 Python 3.7.4 时遇到了同样的问题。

I was able to fix it by downloading Python 3.8 from https://www.python.org/and installing Pygame 2.0.0.dev6 by doing a quick

我能够通过从https://www.python.org/下载 Python 3.8并通过快速安装 Pygame 2.0.0.dev6来修复它

python -m pip install Pygame>=2.0.0.dev6

althoug you might be able to get it to work with a version in between the ones I mentioned.

althoug 你也许可以让它与我提到的版本之间的版本一起工作。