[REBOL] Re: Outputting Image from CGI...
From: ryanc:iesco-dms at: 8-Aug-2001 9:28
'Write-io works beautifully Allen! Thanks!
--Ryan
Allen Kamp wrote:
> Ryan,
>
> There is a script (spacer.r) on rebol.org that I did ages ago, it generates
> and returns a 1x1 colored .gif
>
> basically the final output is
>
> print "Content-Type: image/gif^/"
> write-io system/ports/output gif length? gif
>
> scripts that might be useful to look at
>
http://www.rebol.org/cgi/spacer.html
>
>
http://www.rebol.org/cgi/gif-number.html
>
> Cheers,
>
> Allen K
>
> ----- Original Message -----
> From: "Ryan Cole" <
[ryanc--iesco-dms--com]>
> To: <
[rebol-list--rebol--com]>
> Sent: Wednesday, August 08, 2001 8:39 AM
> Subject: [REBOL] Re: Outputting Image from CGI...
>
> > Coincidentally I am trying to implement a image logger, but so far I am
> > having a problem getting nulls across. example:
> >
> > >> gif-cgi: read/binary http://www.iesco-dms.com/line.r
> > == #{
> > 474946383961C80191FFFFFE010221F9040414FF2CC801020C848FA9CBED0FA3
> > 9CB4DAEB0A3B
> > }
> > >> gif-file: read/binary http://www.iesco-dms.com/line.gif
> > == #{
> > 474946383961C80001009100000000FF0000FFFE010200000021F904041400FF
> > 002C00000000C800010000020C848FA9CBED0FA39CB4DAEB0A003B
> > }
> > >>
> >
> > Here is the code I have been tooling around with:
> > ----------------
> > #!/usr/local/bin/rebol/rebol -cs
> > REBOL[]
> >
> > prin "Content Type: image/gif"
> > prin to-char 10
> > prin to-char 10
> >
> > ;set-modes system/ports/output [binary: true]
> > prin to-string read/binary %line.gif
> >
> > ;con: open/binary console://
> > ;insert con read/binary %line.gif
> > ;close con
> > ----------------
> > As you can see from my commented code, I have tried several methods. I
> > have tried this on Xitami under win98 using REBOL/Core 2.5.0.3.1, and
> > Apache under Linux running REBOL/Core 2.3.0.6.1. I get nothing at all
> > when I open a console port.
> >
> > >> gif: read/binary http://www.iesco-dms.com/line-con.r ;console
> > version of the cgi
> > == #{}
> > >>
> >
> > Any ideas, hints, pointers, suggestions, outright rude remarks, and/or
> > sentiments are welcome.
> >
> > --Ryan
> >
> >
> > Gabriele Santilli wrote:
> >
> > > Hello Jean!
> > >
> > > On 06-Ago-01, you wrote:
> > >
> > > HJ> to-string seems to convert any occurence of (hex) 0D 0D to
> > > HJ> 0D 0A ! ,ie 2 linefeed to linefeed + carriage return
> > >
> > > The culprit is not TO-STRING, but the fact that
> > > system/ports/output is not opened as binary.
> > >
> > > Try:
> > >
> > > port: open/binary console://
> > > insert port read/binart %image.png
> > > close port
> > >
> > > or use SET-MODES on system/ports/output.
> > >
> > > Regards,
> > > Gabriele.
> > > --
> > > Gabriele Santilli <
[giesse--writeme--com]> - Amigan - REBOL programmer
> > > Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/
> > >
> > > --
> > > To unsubscribe from this list, please send an email to
> > >
[rebol-request--rebol--com] with "unsubscribe" in the
> > > subject, without the quotes.
> >
> > --
> >
> >
> > Ryan Cole
> > Programmer Analyst
> > www.iesco-dms.com
> > 707-468-5400
> >
> >
> > --
> > To unsubscribe from this list, please send an email to
> >
[rebol-request--rebol--com] with "unsubscribe" in the
> > subject, without the quotes.
> >
> >
>
> --
> To unsubscribe from this list, please send an email to
>
[rebol-request--rebol--com] with "unsubscribe" in the
> subject, without the quotes.
--
Ryan Cole
Programmer Analyst
www.iesco-dms.com
707-468-5400