image conversion
[1/8] from: th72:dds:nl at: 2-Mar-2006 14:16
Hello List,
I have a problem...
Is it possible to convert binary data to an image?
I use an external program (via call) to produce a image. I can capture
the image via call/output but then I am lost.
Out is then a string! type like this:
{GIF87a
^A+^A=91^-^-=FF=FF=FF^-^-^-=E5=D3=C9^-^-^-,^-^-^-^-
^A+^A^-^B=FF=84=8F=A9=CB=ED^O=A3=9C=B4=DA=8B=B3=DE=BC=FB^O=86=E2H=96=E6=89=A6=EA=CA=B6=EE^K=C7=F2L=D7=F6=8D=E7=FA=CE=F7=FE^O^L
=87=C4=A2=F1=88L*=97=CC=A6=F3^-=8DJ=A7=D4=AA=F5=8A=CDj=B7=DC=AE...
Can I convert this to a REBOL image type so that I can display it with view?
I tried converting it to-binary, but no succes...
Thanks
Tim
[2/8] from: rebolek:gma:il at: 2-Mar-2006 14:49
Hi Tim,
If your image is string!, use following code:
>>image: load to binary! image-in-string
if your image is binary!, it's even easier:
>>image: load image-in-binary
Regards,
rebolek
On 3/2/06, Tim Hendriks <th72-dds.nl> wrote:
> Hello List,
> I have a problem...
<<quoted lines omitted: 15>>
> To unsubscribe from the list, just send an email to
> lists at rebol.com with unsubscribe as the subject.
--
/
Boleslav Brezovsky
http://krutek.info
\
[3/8] from: th72::dds::nl at: 2-Mar-2006 17:57
Thanks Boleslav,
I can see now something that looks like an image, but it's distorted. It
works oke when I first save the data and then load it again. I think
something goes wrong with the line termination characters. Thanks so far.
Tim
Boleslav Brezovsky wrote:
[4/8] from: sags::apollo::lv at: 3-Mar-2006 23:48
BTW how to output image from script to web browser? I tried simplest way by
using content type header for image and then printing out binary string, but
it did not help.
Janeks
On 2 Mar 2006 at 17:57, Tim Hendriks wrote:
>>Thanks Boleslav, >>I can see now something that looks like an image, but
it's distorted. It >works oke when I first save the data and then load it
again. I think >something goes wrong with the line termination characters.
Thanks so far. >>Tim >>Boleslav Brezovsky wrote: >>>Hi Tim, >>>>If your
imageis string!, use following code: >>>> >>>>>>image: load to binary!
image-in-string >>>>     >>>>>>>>if your image is
binary!, it's even easier: >>>> >>>>>>image: load image-in-binary
>>>> #160 >>>>>>>>>>>>Regards, >>>>rebolek >>>>On 3/2/06, Tim
Hendriks <th72-dds.nl> wrote: >> >>>>>Hello List, >>>>>>I have a
problem... >>>>>>Is it possible to convert binary data to an image? >>>>>>I
use an external program (via call) to produce a image. I can capture
[5/8] from: anton:wilddsl:au at: 5-Mar-2006 14:16
binary: make binary! 4000
SAVE/PNG binary logo.gif
Then output the binary.
Anton.
[6/8] from: anton:wilddsl:au at: 5-Mar-2006 14:18
Mmm.. Maybe you can set the console to binary mode
(have to look that up somewhere...) and then hopefully
the output string from CALL won't be touched.
Anton.
[7/8] from: SunandaDH::aol::com at: 4-Mar-2006 23:50
Anton:
> Mmm.. Maybe you can set the console to binary mode
That should work....something like:
binary-data: ---make or load your image here---
print "Content-Type: application/octet-stream"
print newline
set-modes system/ports/output [binary: true]
insert system/ports/output binary-data
quit
Sunanda
[8/8] from: hallvard::ystad::gmail::com at: 5-Mar-2006 8:20
On 03/03/06, sags-apollo.lv <sags-apollo.lv> wrote:
> BTW how to output image from script to web browser? I tried simplest way
> by
> using content type header for image and then printing out binary string,
> but
> it did not help.
Here's what I use (and this works):
data: read/binary %/some/image.jpg
print "Content-Type: image/jpg^/"
write-io system/ports/output data length? data
HY
Janeks
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted