enjeck / jpg2svg

Convert JPG images to SVG
11 stars 3 forks source link

AttributeError: 'potrace._potrace.Bitmap' object has no attribute 'to_xml' #1

Open beckhamchen opened 2 years ago

beckhamchen commented 2 years ago

When running the code, the error occurs:

File "jpg2svg/svg.py", line 65, in extract xml = bmp.to_xml() AttributeError: 'potrace._potrace.Bitmap' object has no attribute 'to_xml'

How to handle it?

enjeck commented 2 years ago

@beckhamchen The official pypotrace package does not have a way to convert to xml. So I'm using mehdidc's fork, which implements it: https://github.com/mehdidc/pypotrace/tree/to_xml. You'll have to clone his repo and checkout the to_xml branch.

beckhamchen commented 2 years ago

@beckhamchen The official pypotrace package does not have a way to convert to xml. So I'm using mehdidc's fork, which implements it: https://github.com/mehdidc/pypotrace/tree/to_xml. You'll have to clone his repo and checkout the to_xml branch.

Perfectly solve my problem! Thank you!