[squeak-dev] Streaming directly from WebResponse content to SketchMorph

Casimiro de Almeida Barreto casimiro.barreto at gmail.com
Wed Oct 17 23:05:40 UTC 2012


Hello,

Is it possible to stream an image (png) directly from WebResponse to a
SketchMorph ? I'd like to avoid the burden of saving image in temporary
file to load it into a SketchMorph.

Tried something like:

...

response contentStream binary.
sm := SketchMorph fromStream: resp contentStream.

It fails. Don't know image type.

An alternative would be creating a socket interface so I stream image to
socket and read from the socket... but it would be verbose... would
involve forking... would be kind of a dirty job.

[ response streamTo: sock size: response contentLength progress: nil ]
fork. (...)

sm := SketchMorph fromStream: sock. (...)


If some of you can give me a light in this subject... :)

Best regards,

CdAB

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 259 bytes
Desc: OpenPGP digital signature
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20121017/ff406b04/signature.pgp


More information about the Squeak-dev mailing list