|
Posted by Andrew @ Rockface on 07/02/05 13:36
shawn wrote:
> Hi,
>
> I downloaded a piegraph class from phpclasses.org
> (http://www.phpclasses.org/browse/file/9316.html) and was able to show the
> sample pie graph. However if I include it directly in my code all are
> gibberish. I need to use <embed src="myfiles/pie.php"> to display it using
> browser's plug-in. In my case, Quicktime was the one to handle the phg
> format.
>
> The problem is: this works only on machine where Quicktime is already in
> place. If a browser doesn't have a png handler, for example without
> Quicktime, the embed simply displays as an empty image box. I was trying to
> add some parameter to the code like below:
>
> <embed src="pie.php" width="300" height="100" MIME-Type="image/x-png;
> image/png">
>
> but it didn't see to have any impact.
>
> I can't ask visitors to install Quicktime on their machines. All I wanted is
> to be able to show this dynamic generated png image in a php web page. Could
> someone tell me what I have not done right here and what is the proper way
> of doing this?
I think I see what's happening. The class is displaying the png direct -
it sends a header of 'Content-type: image/png'. I think you are trying
to insert it in a page where you've already sent a header.
Try changing one of the last lines in the piegraph class code from:
imagepng($final);
To:
imagepng($final, "test.png");
Then create a regular <img src="test.png">.
--
Andrew @ Rockface
www.rockface-records.co.uk
"Pablo Picasso never got called an asshole"
Navigation:
[Reply to this message]
|