Instead of saving an image into a file using write-image-to-file I was trying to provide a hunchentoot handler which outputs an array of bytes (just like in the hunchentoot test.lisp image-ram-page example). For this I thought write-jpeg-to-stream would be the best 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 '(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 function for the task. I also tried to create a stream with flexi-stream:
<a class="none" name="make-in-memory-output-stream">make-in-memory-output-stream without any success.<br><br>Thank you,<br>Andrew<br></a><b><a class="none" name="make-in-memory-output-stream"></a></b>