[Bioperl-l] problem with Graphics

Lincoln Stein lstein at cshl.edu
Tue Sep 9 18:56:46 EDT 2003


If you are using ActiveState perl on Windows or RedHat Perl (which is a bad 
thing -- get rid of it), then you must do this:

	binmode(STDOUT);
	print $panel->png;

Somebody decided that it would be great idea to enable linefeed/carriage 
return translation by default on these platforms.

Lincoln

On Thursday 14 August 2003 11:54 pm, Wes Barris wrote:
> Sean O'Brien wrote:
> > Hi,
> >
> > I have been trying to get BioPerl to output png's, but I seem to be
> > getting invalid png files.  I have a fresh install of libgd, version
> > 2.0.15 and my GD version is 2.07.  I installed Bundle::BioPerl, and after
> > having no luck, I installed BioPerl version 1.2.2 from the sources in
> > current_core_stable.tar.gz.  When I run 'make test' I get an ok for
> > BioGraphics.  Also, when I run the first script described in the Bio
> > Graphics tutorial, it runs with no errors and outputs some data which
> > appears as though it could be an image.  However, the file seems to be of
> > an invalid png format because it cannot be opened by display, galeon or
> > the GIMP.  This is pretty frustrating because everything apears to be
> > installing/running fine, but then the image is somehow corrupted.  What
> > might I have done wrong/ need to do to make this work.  Thanks.
>
> Hi Sean,
>
> The examples that output png files never worked for me either.  To fix
> them, I changed this line:
>
> print $panel->png;
>
> to something like this:
>
> open(OUT, ">junk.png");
> binmode OUT;
> print OUT $panel->png;
> close(OUT);
> print("Wrote junk.png\n");

-- 
Lincoln Stein
lstein at cshl.edu
Cold Spring Harbor Laboratory
1 Bungtown Road
Cold Spring Harbor, NY 11724
(516) 367-8380 (voice)
(516) 367-8389 (fax)


More information about the Bioperl-l mailing list