[Bioperl-l] Teaching with BioPerl this summer
Jim Hu
jimhu at tamu.edu
Sat May 5 20:35:51 UTC 2012
I am not a GD expert by any stretch, but my understanding is that a CGI using GD can return the image with an appropriate http header, such as:
print "Content-type: image/png\n\n";
followed by outputting the image from the GD object. However, to embed the image in a web page with other content, I always did it by outputting to a tmp file and used an img tag to access the file. Is there another way to do this? I suppose that the img tag could link to another cgi that actually generates the image...
I guess having a second cgi in their library that uses GD::Graph would work the same way. But the RGraph library is really easy to use, and it will delegate the processing of the image to the client, which may be useful at some point in the future if we can actually get the students to help with online teaching tools that will be clicked on simultaneously by classes with hundreds of students.
Jim
On May 5, 2012, at 10:40 AM, Mike Williams wrote:
>
>
> On Fri, May 4, 2012 at 2:08 PM, Jim Hu <jimhu at tamu.edu> wrote:
>
> Anyway, in case anyone is interested my tentative plan (which has to become a real plan in a couple of weeks) is:
>
> - next have them use Perl to calculate a simple math function (factorials). Again, make a shell and cgi-bin version. For the cgi, use templates based on the RGraph javascript library to plot the data in an HTML5 canvas. I like the idea of using HTML5 instead of GD making png files based on not having to link to images in a tmp directory.
>
> You can use GD to send an image directly to the browser without creating a file.
>
> Mike
>
=====================================
Jim Hu
Professor
Dept. of Biochemistry and Biophysics
2128 TAMU
Texas A&M Univ.
College Station, TX 77843-2128
979-862-4054
More information about the Bioperl-l
mailing list