1

使用 python Pillow 从 PNG 或 JPG 创建的 ICO 无法在 Windows XP 上运行。ICO 在 Vista 和更高版本上运行良好。

我写了一个简单的代码来证明一个在 XP 上运行并用 PIL 保存的 ICO 在 XP 上破坏了它:

from PIL import Image
original = Image.open('favicon.ico') # you can try with whatever format
original.save('newfavicon.ico') # not recognized on XP

我正在使用 Python 2.7。

你知道 XP 上的 ICO 有什么特别之处吗?

你有其他我可以尝试的库的建议吗?

4

1 回答 1

0

它不适用于 Pillow,因为 ICO 保存为 PNG 格式,请在此处查看答案https://github.com/python-pillow/Pillow/issues/1102

它与 PythonMagick 一起正常工作。

于 2015-02-16T14:45:23.890 回答