Lisp HUG Maillist Archive

Read external image from stream

Hi List,

Does anyone know of a way to load an external image (in GP) from a stream? There is no such documented functionality, but maybe there is some other way?

(An obvious workaround would be to write the image to file and then load it with gp:read-external-image, but I would prefer not to use a temporary files)

Thanks
Erik


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: Read external image from stream

In my RSS reader app, I do this with my HTTP package (http://github.com/massung/http) to download an image from a web server and display it in my app.

https://gist.github.com/massung/c55f6baac7159b79bf01

Lines  18, 27, and 28 are probably what you will care about. I don't know if what I'm doing is *technically* legal, but it works just fine for me. I agree, though, it would be very nice if LispWorks provided a read-external-image-from-stream or read-external-image-from-bytes function (or at least acknowledge in the documentation that making one and filling out :data yourself is legal).

NOTE: On Windows this really doesn't work out all that well because LWW only seems to understand the BMP format. On Mac OS X, the above works great for JPG, PNG, etc.

Hope this helps,

Jeff M.

Erik Ronström
Friday, November 08, 2013 3:10 AM
Hi List,

Does anyone know of a way to load an external image (in GP) from a stream? There is no such documented functionality, but maybe there is some other way?

(An obvious workaround would be to write the image to file and then load it with gp:read-external-image, but I would prefer not to use a temporary files)

Thanks
Erik


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html

Updated at: 2020-12-10 08:34 UTC