[REBOL] Re: jpeg images not working
From: tim:johnsons-web at: 28-Aug-2002 19:23
* G. Scott Jones <[gscottjones--mchsi--com]> [020828 18:46]:
> From: "Tim Johnson"
> > I'm attempting to use rebol to push jpeg
> > images to a a web page. Rendering is not working.
> >
> > The beginning source of this looks as follows (between asterisks):
> > *********************************************************************
> > HTTP/1.0 200 OK
> > Content-type: multipart/x-mixed-replace; boundary=--myboundary
> >
> > --myboundary
> > Content-type: image/jpeg
> >
> > #{
> > FFD8FFE000104A46494600010101025802580000FFDB00430001010101010101
> > 0101010101010101010101010101010101010101010101010101010101010101
> > *********************************************************************
> >
> > The '#{' appears to be the problem. How to I keep that
> > from appearing?
> > The code to write and write the images is as follows:
> > .....
> > t: read/binary to-file base-file
> > print copy t
> > .....
> > How may I correct this?
>
> Hi, Tim,
>
> I am unfamiliar with "multipart/x-mixed-replace", but I can get the
> following code to work (note your paths may be different). Maybe you can
> adapt this to your fancier mime type:
>
> #!/path/to/rebol --cgi -s
> REBOL []
> t: read/binary %//rebol/view/nyc.jpg
> print "Content-type: image/jpeg^/"
> set-modes system/ports/output [binary: true]
> foreach u t [insert system/ports/output to-char u]
>
> --Scott Jones
Thank you Scott:
The following code modified by your example with correct paths
for my system (between the asterisks)
***************************************************************
#!/usr/bin/rebol -cs
REBOL []
t: read/binary %../images/camera-1/Bed-Tax-Logo.jpg
print "Content-type: image/jpeg^/"
set-modes system/ports/output [binary: true]
foreach u t [insert system/ports/output to-char u]
***************************************************************
Is working intermittenly, but that is better than I've had
before, I believe that you're on to something here...
I'm in a time zone that puts me currently into the end of my
day. Will try again tomorrow morning.
Thank you very much!
-tim-
> --
> To unsubscribe from this list, please send an email to
> [rebol-request--rebol--com] with "unsubscribe" in the
> subject, without the quotes.
--
Tim Johnson <[tim--johnsons-web--com]>
http://www.alaska-internet-solutions.com
http://www.johnsons-web.com