Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Outputting Image from CGI...

From: ryanc::iesco-dms::com at: 7-Aug-2001 15:39

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