Code Comments
Programming Forum and web based access to our favorite programming groups.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,
Post Follow-up to this messageOn 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
Post Follow-up to this message> > 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....
Post Follow-up to this message> > 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....
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.