fkxxyz / ssfconv

Sogou input method skin file (.ssf file) converter, supports conversion to fcitx or fcitx5 format.
GNU General Public License v3.0
190 stars 24 forks source link

IndexError #5

Closed zetako closed 3 years ago

zetako commented 3 years ago

转换fcitx5皮肤的时候出现错误

Traceback (most recent call last):
  File "/usr/bin/ssfconv", line 1203, in <module>
    exit(main(args))
  File "/usr/bin/ssfconv", line 1175, in main
    result = ssr2fcitx5(skin_dir)
  File "/usr/bin/ssfconv", line 819, in ssr2fcitx5
    back_color = findBackgroundColor()
  File "/usr/bin/ssfconv", line 801, in findBackgroundColor
    return getImageAvg(skin_dir + os.sep + image_name,
  File "/usr/bin/ssfconv", line 118, in getImageAvg
    if a[y][x][3] > 0:
IndexError: index 3 is out of bounds for axis 0 with size 3

转换使用的文件: 1.zip

fkxxyz commented 3 years ago

感谢,由于没有考虑到搜狗皮肤用的图片可能是 24 位深度缘故导致,只考虑了 32 位,现在将改进。