[Bioperl-l] problems iwth Bio::graphics module

Torsten Seemann torsten.seemann at infotech.monash.edu.au
Mon May 22 21:53:02 UTC 2006


Chen Li

>  perl render_blast1.pl data1.txt >im.png

Based on http://bioperl.org/wiki/HOWTO:Graphics I believe the example 
script is creating a PNG image. The last line is:
print $panel->png;

> and Perl runs without any problem. I use adobe
> photoshop to open them and Adobe can't recognize them.
> If I use ACDSee to open them I only get a black
> background. If I issue this line under Cygwin X window
> display im.png  or display im.gif
> Cygwin says:
> display: Improper image header `im.png'.
> It seems Perl can't produce an image with right
> format.

Are you sure Perl is producing a PNG file at all?
How many bytes does im.png use? Zero?

Did you notice this in http://bioperl.org/wiki/HOWTO:Graphics ?

It says: "If you are on a Windows platform, you need to put STDOUT into 
binary mode so that the PNG file does not go through Window's carriage 
return/linefeed transformations. Before the final print statement, put 
the statement binmode(STDOUT)."

ie. your script should have

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

as the last 2 lines.

> Do you experience the same problem before?

No.

--Torsten



More information about the Bioperl-l mailing list