[Haskell-cafe] Streaming to JuicyPixels

Vincent Berthoux vincent.berthoux at gmail.com
Tue Feb 21 00:01:39 CET 2012


 I can expose the low level parsing, but you would only get the
chunks/frames/sections of the image, Cereal is mainly used to parse the
structure of the image, not to do the raw processing. For the raw
processing, I rely on `remaining >> getBytes` to be able to manipulate data
at bit level or to feed it to zlib, and the documentation clearly state
that remaining doesn't work well with runGetPartial, so no read ahead, but
even worse for streaming :).

To be fair, I never thought of this use case, and exposing a partially
decoded image would impose the use of the ST Monad somehow, and Serialize
is not a monad transformer, making it a bit hard to implement.

By curiosity what kind of API would you hope for this kind of functionality?


Vincent Berthoux

Le 20 février 2012 22:08, Myles C. Maxfield <myles.maxfield at gmail.com> a
écrit :

> Hello,
> I am interested in the possibility of using JuicyPixels for streaming
> images from the web. It doesn't appear to expose any of its internally-used
> Serialize.Get functionality, which is problematic for streaming - I would
> not like to have to stream the whole image into a buffer before the decoder
> can start decoding. Are there any plans on exposing this API, so I can use
> the runGetPartial function to facilitate streaming?
> In addition, does the library do much readahead? There's no point in
> exposing a Get interface if it's just going to wait until the stream is
> done to start decoding anyway.
>  Thanks,
> Myles C. Maxfield
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120221/21c2d3ea/attachment.htm>

More information about the Haskell-Cafe mailing list