|
Posted by Jasper Bryant-Greene on 10/25/05 04:45
On Mon, 2005-10-24 at 20:14 -0400, Chris wrote:
> I don't understand what is going on with a simple example I created to
> understand how GD graphics are presented in a web page.
[[snip]]
> However if I replace:
> <img src=graphic.php>
>
> with
>
> <img src=<?php
> $image = imagecreatefrompng("my_graphic.png");
> imagepng($image);
> ?> >
>
> my_graphic.png is no longer displayed and the web page gets filled with
> random characters.
>
> Why is this happening or what am I missing.
You're not missing anything. That is exactly the expected behaviour. You
can call graphic.php with GET variables if you need to pass information
on, but you can't put images inline like that except for with data:
URIs.
data: URIs are currently only supported by Gecko browsers (Mozilla,
Firefox, etc) and maybe Safari or Opera (not sure about the latter two).
Do a search for "data: URI RFC" or similar to find out about them.
--
Jasper Bryant-Greene
General Manager
Album Limited
e: jasper@album.co.nz
w: http://www.album.co.nz/
p: 0800 4 ALBUM (0800 425 286) or +64 21 232 3303
a: PO Box 579, Christchurch 8015, New Zealand
Navigation:
[Reply to this message]
|