Home > Archive > PERL Beginners > April 2008 > Can't locate object method "gif" via package "GD::Image"
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Can't locate object method "gif" via package "GD::Image"
|
|
| Sivasakthi 2008-04-02, 8:08 am |
| Hi all,
I have installed Perl-GD , and tried to use the GD::Image
it throws the following error message ,
Can't locate object method "gif" via package "GD::Image"
how can i eliminate the above error?
Thanks,
| |
| Zentara 2008-04-02, 7:18 pm |
| On Wed, 02 Apr 2008 17:37:11 +0530, msivasakthi@gmail.com (sivasakthi)
wrote:
>Hi all,
>
>
>I have installed Perl-GD , and tried to use the GD::Image
>
>it throws the following error message ,
>
>Can't locate object method "gif" via package "GD::Image"
>
>
>how can i eliminate the above error?
>
>
>Thanks,
You don't say what platform or version levels you are using,
but the best bet is to upgrade to the latest gd c library from
boutell.com then install the latest Perl GD module.
http://www.boutell.com/gd/
Read the README that comes with the GD module... from the
Frequently Asked Questions
########################################
##################
4. My scripts fail with "Can't locate object method 'png' via package
"GD::Image".
libgd can now be built with support for one or more of the PNG, GIF,
XPM or
JPEG formats. If one or more of these formats are not supported by
libgd, then
the corresponding GD::Image methods will be unavailable.
Unfortunately, many
older scripts assume that the png() method will always be present.
You can
work around this issue with code like the following:
my $image = $gd->can('png') ? $gd->png : $gd->gif;
or if you prefer eval {}
my $image = eval {$gd->png} || $gd->gif;
As of libgd 2.0.33, GIF support is always compiled in, so (for the
time being!)
this is a safe fallback.
########################################
###############
zentara
--
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html
| |
| Sivasakthi 2008-04-03, 8:11 am |
|
>
> You don't say what platform or version levels you are using,
> but the best bet is to upgrade to the latest gd c library from
> boutell.com then install the latest Perl GD module.
> http://www.boutell.com/gd/
>
> Read the README that comes with the GD module... from the
> Frequently Asked Questions
> ########################################
##################
> 4. My scripts fail with "Can't locate object method 'png' via package
> "GD::Image".
>
> libgd can now be built with support for one or more of the PNG, GIF,
> XPM or
> JPEG formats. If one or more of these formats are not supported by
> libgd, then
> the corresponding GD::Image methods will be unavailable.
> Unfortunately, many
> older scripts assume that the png() method will always be present.
> You can
> work around this issue with code like the following:
>
> my $image = $gd->can('png') ? $gd->png : $gd->gif;
>
> or if you prefer eval {}
>
> my $image = eval {$gd->png} || $gd->gif;
>
> As of libgd 2.0.33, GIF support is always compiled in, so (for the
> time being!)
> this is a safe fallback.
> ########################################
###############
>
>
> zentara
> --
> I'm not really a human, but I play one on earth.
> http://zentara.net/japh.html
>
I have tested in RHEL 5 release ...
# uname -a
Linux TEST 2.6.18-36.el5 #1 SMP Fri Jul 20 14:27:44 EDT 2007 ia64 ia64
ia64 GNU/Linux
I have upgraded GD to GD-2.35 version.. now its works correctly..
Thanks....
| |
| Sivasakthi 2008-04-03, 8:11 am |
|
>
> You don't say what platform or version levels you are using,
> but the best bet is to upgrade to the latest gd c library from
> boutell.com then install the latest Perl GD module.
> http://www.boutell.com/gd/
>
> Read the README that comes with the GD module... from the
> Frequently Asked Questions
> ########################################
##################
> 4. My scripts fail with "Can't locate object method 'png' via package
> "GD::Image".
>
> libgd can now be built with support for one or more of the PNG, GIF,
> XPM or
> JPEG formats. If one or more of these formats are not supported by
> libgd, then
> the corresponding GD::Image methods will be unavailable.
> Unfortunately, many
> older scripts assume that the png() method will always be present.
> You can
> work around this issue with code like the following:
>
> my $image = $gd->can('png') ? $gd->png : $gd->gif;
>
> or if you prefer eval {}
>
> my $image = eval {$gd->png} || $gd->gif;
>
> As of libgd 2.0.33, GIF support is always compiled in, so (for the
> time being!)
> this is a safe fallback.
> ########################################
###############
>
>
> zentara
> --
> I'm not really a human, but I play one on earth.
> http://zentara.net/japh.html
>
I have tested in RHEL 5 release ...
# uname -a
Linux TEST 2.6.18-36.el5 #1 SMP Fri Jul 20 14:27:44 EDT 2007 ia64 ia64
ia64 GNU/Linux
I have upgraded GD to GD-2.35 version.. now its works correctly..
Thanks....
|
|
|
|
|