【问题标题】:Pebble watch font2png.py, "An Integer is Required" errorPebble watch font2png.py,“需要整数”错误
【发布时间】:2013-05-04 02:21:50
【问题描述】:

Pebble Github: font2png.py

我很难让这段代码运行。我正在尝试使用 font2png.py 但它不起作用。我运行命令

python fonttools/font2png.py

我不断收到这些错误:

Traceback (most recent call last):
  File "fonttools/font2png.py", line 92, in <module>
    tile_image.save(OUTPUT_IMAGE_FILEPATH_TEMPLATE % digit)
  File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 1439, in save
    save_handler(self, fp, filename)
  File "/usr/lib/python2.7/dist-packages/PIL/PngImagePlugin.py", line 572, in _save
    ImageFile._save(im, _idat(fp, chunk), [("zip", (0,0)+im.size, 0, rawmode)])
  File "/usr/lib/python2.7/dist-packages/PIL/ImageFile.py", line 481, in _save
    e = Image._getencoder(im.mode, e, a, im.encoderconfig)
  File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 399, in _getencoder
    return apply(encoder, (mode,) + args + extra)
TypeError: an integer is required

有什么想法吗?我有正确路径中的字体和一切。如果有任何区别,我正在使用 Roboto-Condensed.ttf。

【问题讨论】:

    标签: python python-imaging-library pebble-watch


    【解决方案1】:

    试试

     python -m pdb font2png.py
    

    然后使用交互式调试器查看数据以查看为什么会崩溃。

    然后在 Github 上提交项目的错误和/或补丁。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多