xlzd / img2html Goto Github PK
View Code? Open in Web Editor NEWConvert image to HTML
License: Do What The F*ck You Want To Public License
Convert image to HTML
License: Do What The F*ck You Want To Public License
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'
progress: 100.00%root@DESKTOP-G3JIH3M:/mnt/c/Users/liguobao# img2html -c '伊' -s 10 -i ./yibaobao.jpg -o yibaobao.html
progress: 100.00%Traceback (most recent call last):
File "/usr/local/bin/img2html", line 11, in
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/img2html/init.py", line 37, in main
html = converter.convert(getattr(args, 'in'))
File "/usr/local/lib/python2.7/dist-packages/img2html/converter.py", line 89, in convert
return self.render(html_image)
File "/usr/local/lib/python2.7/dist-packages/img2html/converter.py", line 99, in render
width=self.font_size * len(html_image[0]) * 2
File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 1008, in render
return self.environment.handle_exception(exc_info, True)
File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 780, in handle_exception
reraise(exc_type, exc_value, tb)
File "", line 20, in top-level template code
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 0: ordinal not in range(128)
我只会JAVA,刚刚把环境都配置好了,但是运行没报错,也没啥提示就改了一个地方
html = converter.convert(getattr(args, 'C:\123.png'))
然后RUN。结果
C:\Python27\python.exe C:/source/img2html-master/img2html/init.py
Process finished with exit code 0请问要咋弄啊。
我增加了对Python3.x的支持,可以参考:https://github.com/cocos56/img2html
demo是你暗恋的对象?
D:\Workspace>img2html -i baby.jpg -o out.html
Traceback (most recent call last):
File "D:\Software\Python3_6\Scripts\img2html-script.py", line 11, in
load_entry_point('img2html==0.0.7', 'console_scripts', 'img2html')()
File "d:\software\python3_6\lib\site-packages\img2html_init_.py", line 35, in main
font_family=args.font,
File "d:\software\python3_6\lib\site-packages\img2html\converter.py", line 73, in init
char = char.decode('utf-8')
AttributeError: 'str' object has no attribute 'decode'
CC0-1.0 has the same sentiment as the WTFPL (do whatever you want, no attribution, I don't own the copyright.) but is not a "crayon license" and is approved by the FSF. Using a standardized license helps your code become more prolific, especially in a corporate setting where legalese is expected from a license. CC0-1.0 also disclaims warranty and damages which the WTFPL does not do.
Raw: https://creativecommons.org/publicdomain/zero/1.0/
Text: LICENSE.txt
excited!
这图也太暴力了
牛
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.