pyfpdf
pyfpdf copied to clipboard
image loading from url does not work - with quick and dirty fix
I tried to open an existing image from an URL and produced the follwing error message:
File "C:\CAE\Python\lib\site-packages\fpdf\image_parsing.py", line 23, in load_resource
f = BytesIO(urlopen(filename).read())
NameError: name 'urlopen' is not defined
My fix for this is this patch to image_parsing.py:
6a7,8
> # without this line images cannot be loaded from URLs (tested with Python 3.8)
> from urllib.request import urlopen