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
We don't currently have a constructor for taking a Lua bytestream and turning it into an hs.image object, for example if one is fetching an image with hs.http.
(we have hs.image.imageFromURL(), but afaics that's a blocking call)
The text was updated successfully, but these errors were encountered:
If the binary data is encoded as a URL string, hs.image.imageFromURL will convert it to an image... as I recall, an encoded image string is base64 encoded with a prefix of `data:;base64,'.
hs.image:encodeAsURLString will take an existing image you've picked up from some source and convert it into a proper string for you (my intention was to add image saving to my clipboard manager, but I haven't got around to it yet)
Or do you want something that can take incoming binary data as a stream (like stdin and hs.task)?
I think at the time I filed this, I was mostly thinking about fetching an image with the async variants of hs.http, but stdin/hs.task are also possibilities.
We don't currently have a constructor for taking a Lua bytestream and turning it into an hs.image object, for example if one is fetching an image with hs.http.
(we have hs.image.imageFromURL(), but afaics that's a blocking call)
The text was updated successfully, but these errors were encountered: