xlzd / img2html

Convert image to HTML
Do What The F*ck You Want To Public License
839 stars 126 forks source link

Python3.54rc1 报错 #13

Open jingwangnet opened 6 years ago

jingwangnet commented 6 years ago
jingwang@jingwang-pc:~$ sudo img2html -s 25 -c '静' -t 'jing.wang' -i ~/Pictures/Wallpapers/174fea21dd2d2f0d99a8d9c5de412757.jpg  -o test.html
Traceback (most recent call last):
  File "/usr/local/bin/img2html", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.5/dist-packages/img2html/__init__.py", line 35, in main
    font_family=args.font,
  File "/usr/local/lib/python3.5/dist-packages/img2html/converter.py", line 73, in __init__
    char = char.decode('utf-8')
AttributeError: 'str' object has no attribute 'decode'
jingwangnet commented 6 years ago

pip 安装的 img2html-0.0.7

DawN1ng commented 6 years ago

decode那一行和它的判断条件一起删掉,next()方法都改为next(),xrange()方法都改为range()