[Bioperl-l] Teaching with BioPerl this summer
Smithies, Russell
Russell.Smithies at agresearch.co.nz
Sun May 6 21:00:34 UTC 2012
Several browsers support inline data for images and I've done it before as a simple method of transferring data between servers i.e. the alignments and images were created on one server, the html with embedded images created, then ssh'ed to an external web server.
It works very well , take a look at http://en.wikipedia.org/wiki/Data_URI_scheme
eg.
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA
AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
9TXL0Y4OHwAAAABJRU5ErkJggg==" alt="Red dot">
Russell Smithies
Infrastructure Technician
T 03 489 9085
M 027 4734 600
E russell.smithies at agresearch.co.nz
Invermay Agricultural Centre
Puddle Alley, Private Bag 50034, Mosgiel 9053, New Zealand
T +64 3 489 3809 F +64 3 489 3739 www.agresearch.co.nz
-----Original Message-----
From: bioperl-l-bounces at lists.open-bio.org [mailto:bioperl-l-bounces at lists.open-bio.org] On Behalf Of Jim Hu
Sent: Sunday, 6 May 2012 8:36 a.m.
To: Mike Williams
Cc: bioperl-l at portal.open-bio.org
Subject: Re: [Bioperl-l] Teaching with BioPerl this summer
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
_______________________________________________
Bioperl-l mailing list
Bioperl-l at lists.open-bio.org
http://lists.open-bio.org/mailman/listinfo/bioperl-l
=======================================================================
Attention: The information contained in this message and/or attachments
from AgResearch Limited is intended only for the persons or entities
to which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipients is prohibited by AgResearch
Limited. If you have received this message in error, please notify the
sender immediately.
=======================================================================
More information about the Bioperl-l
mailing list