Problems rendering an image
[1/4] from: tim::johnsons-web::com at: 28-Aug-2002 7:53
Hello Rebols:
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?
TIA
--
Tim Johnson <[tim--johnsons-web--com]>
http://www.alaska-internet-solutions.com
http://www.johnsons-web.com
[2/4] from: g:santilli:tiscalinet:it at: 29-Aug-2002 1:57
Hi Tim,
On Wednesday, August 28, 2002, 5:53:49 PM, you wrote:
TJ> print copy t
First of all, COPYing here is useless and wastes memory and time.
Other than that, if you want to send the image as binary (as I
suppose) you could:
set-modes system/ports/output [binary: true]
insert system/ports/output t
; reset binary mode if needed
Regards,
Gabriele.
--
Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer
Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r
[3/4] from: tim:johnsons-web at: 28-Aug-2002 16:54
* Gabriele Santilli <[g--santilli--tiscalinet--it]> [020828 16:39]:
> Hi Tim,
> On Wednesday, August 28, 2002, 5:53:49 PM, you wrote:
<<quoted lines omitted: 5>>
> insert system/ports/output t
> ; reset binary mode if needed
Hi Gabriele:
I'm come a long ways since I posted this above.
I am now using
prin enbase/base read/binary to-file base-file 16
And I am getting the following (with the binary stream truncated):
between the asterisks:
******************************************************************
HTTP/1.0 200 OK
Content-type: multipart/x-mixed-replace; boundary=--myboundary
--myboundary
Content-type: image/jpeg
FFD8FFE000104A464946000101010258 ;; truncated
--myboundary
******************************************************************
<sigh>still no rendering</sigh>
Now what do you think?
Thanks Gabriele!
--
Tim Johnson <[tim--johnsons-web--com]>
http://www.alaska-internet-solutions.com
http://www.johnsons-web.com
[4/4] from: g:santilli:tiscalinet:it at: 29-Aug-2002 16:00
Hi Tim,
On Thursday, August 29, 2002, 2:54:43 AM, you wrote:
TJ> Now what do you think?
You should either provide a Content-Transfer-Encoding header and
use base 64 encoding, or send the image as binary as I have
suggested in my previous email.
Content-Transfer-Encoding: base64
Content-Type: image/jpeg
....etc......
The browser doesn't know what to do with your hex-encoded data...
Regards,
Gabriele.
--
Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer
Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted