You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now it's only possible to load image from a file. I have a use case where I would like to load image from a buffer, specifically the the response contents returned by requests library, e.g.:
_lycon.PyconError: Assertion Failure: `str` evaluated to false in `string_from_pyobject` (/tmp/pip-install-nv5q896g/lycon/src/lycon/python/interop.cc:322)
A gross work around is to write to a temp file and then read from that:
(fdesc, fname) = tempfile.mkstemp(prefix='tmp-lycon-hack-')
os.write(fdesc, png_dat)
os.close(fdesc)
dat = lycon.load(fname)
os.remove(fname)
return dat
It looks from reading the source that Lycon really only supports passing a file name argument to lycon.load(). This makes it impossible to load images from container formats such as a zipfile using lycon and various other uses. I was excited to learn about a faster library than PIL.Image, but the API is a dealbreaker for me.
Right now it's only possible to load image from a file. I have a use case where I would like to load image from a buffer, specifically the the response contents returned by
requests
library, e.g.:The text was updated successfully, but these errors were encountered: