Thanks, Edi. I didn't know about send-headers. Now everything works.<br><br><br><div><span class="gmail_quote">On 5/30/07, <b class="gmail_sendername">Edi Weitz</b> <<a href="mailto:edi@agharta.de">edi@agharta.de</a>
> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">On Wed, 30 May 2007 10:42:40 -0400, "Andrei Stebakov" <<a href="mailto:lispercat@gmail.com">
lispercat@gmail.com</a>> wrote:<br><br>> Instead of saving an image into a file using write-image-to-file I<br>> was trying to provide a hunchentoot handler which outputs an array<br>> of bytes (just like in the hunchentoot
test.lisp image-ram-page<br>> example). For this I thought write-jpeg-to-stream would be the best<br>> candidate so I did following:<br>><br>> (let ((s (make-string-output-stream :element-type '(unsigned-byte 8))))
<br>> (write-jpeg-to-stream s :image bg-image)<br>> (let ((image-data (make-array (image-size bg-image) :element-type<br>> '(unsigned-byte 8))))<br>> (read-sequence image-data s)<br>
> image-data)))))))<br>><br>> For which the SBCL complains:<br>> #<SB-IMPL::STRING-OUTPUT-STREAM {CE6D171}> is not a binary output stream.<br>><br>> I am wondering if I am doing the right thing and choosing the right
<br>> function for the task. I also tried to create a stream with<br>> flexi-stream:make-in-memory-output-stream without any success.<br><br>MAKE-STRING-OUTPUT-STREAM can't work because it's a /string/ stream,
<br>as the name says. The FLEXI-STREAMS approach should work, though. If<br>it doesn't, show us your code.<br><br>I wonder why you're doing all this, though. Why don't you write<br>directly to the Hunchentoot stream? (You know about SEND-HEADERS,
<br>don't you?)<br><br>Cheers,<br>Edi.<br>_______________________________________________<br>cl-gd-devel site list<br><a href="mailto:cl-gd-devel@common-lisp.net">cl-gd-devel@common-lisp.net</a><br><a href="http://common-lisp.net/mailman/listinfo/cl-gd-devel">
http://common-lisp.net/mailman/listinfo/cl-gd-devel</a><br></blockquote></div><br>