[pmwiki-devel] php imagepng

Hans design5 at softflow.co.uk
Wed Nov 8 09:52:11 CST 2006


Hi,
I felt inspired by reading the page about PHPImages, and thought
the thermometer image could be generated in a standard cookbook
recipe script. All is fine, but I wonder about outputting the raw
image imagepng() produces on a wiki page.

The standard php way is to create a php script like
<?php
   ....code for aquiring or building $image....
   header("content-type: image/png");
   imagepng($image);
?>

and then inserting in your html an image tag with
  src='path to script'

Now I wonder if there is a way for the function called by a markup
directive to return the image directly, without having to insert an
ugly link to a php script masquerading as a png image.
Something like:
   $out = ConverRawToHTMLImageTag(imagepng($image));
   return Keep($out);
  
i.e. how can ConvertRawToHTMLImageTag work?
   

 Hans




More information about the pmwiki-devel mailing list