Subject: | bug in GD::Graph |
Date: | Tue, 01 Aug 2006 17:27:03 -0600 |
To: | bug-GDGraph [...] rt.cpan.org |
From: | John McCarty <john.mccarty [...] coronasolutions.com> |
Hello,
I'm working on some Perl code, and noticed what appears to be a bug in GD::Graph.... maybe I'm not seeing it correctly though.
In Graph.pm, function "_read_logo_file", the variable $gdimport is set equal to the return from $self->export_format.
"export_format" returns either an array of image formats that the system can handle, or the first item in that array.
In this case ("_read_logo_file"), it will return the first item in that array, which is "gif".
So, the variable $gdimport is set to the string "newFromGif", always.
This posses a problem in that the LOGO being used/read may not be a gif file.
In my case, it is a png. As the code is, it may return a file format that is not the same as the file being opened, resulting
in an error.
Perhaps "_read_logo_file" should get the array of possible formats, then loop thru that array trying to open the LOGO file... if it is
able to open it with one of the formats, great; if not, then issue the error about not being able to read the file.
thank you,
john mccarty