Author Topic: GD::Image workaround?  (Read 1675 times)

0 Members and 1 Guest are viewing this topic.

Offline isak

  • Newbie
  • *
  • Posts: 6
GD::Image workaround?
« on: October 10, 2006, 03:18:32 PM »
When I try to upload an image, i get this error:

Quote
Can't locate object method "jpeg" via package "GD::Image"

I asked my webhost if they could install GD::Image. They said:

Quote
Unfortunately we cannot, the dependncies it requires tend to break the server
(we've tried this in the past, with no luck at all).

Is there a workaround?

Offline EZ

  • Hero Member
  • *****
  • Posts: 1081
    • Babelnotes.be
Re: GD::Image workaround?
« Reply #1 on: October 10, 2006, 05:38:47 PM »
Could your host confirm that they have GD installed but not GD::image?

(this question is important)  If that is the case, we have to work without GD.  It will mean longer loading times for your thumbnails page, but well...  it has to go that way.

Just to let you know what the problem is: the script autodetects the GD perl module on your server, but some hosts do not install it fully for whatever reason.  In your case, the script found the GD module and assumes it is complete, while you host only installed part of it.

Can you let your host confirm this?  Then we can go for a script hack that tells the script that there's no GD at all.

Offline isak

  • Newbie
  • *
  • Posts: 6
Re: GD::Image workaround?
« Reply #2 on: October 10, 2006, 07:25:05 PM »
Running the advanced-test script, I have GD & GDBM_file installed. My host confirms that GD::Image is not and will not be installed because of the problems it has caused them in the past. Does that answer your question?

Offline EZ

  • Hero Member
  • *****
  • Posts: 1081
    • Babelnotes.be
Re: GD::Image workaround?
« Reply #3 on: October 11, 2006, 02:59:37 AM »
look for this code in the script (underneath the script options):

Code: [Select]
my $use_GD; # set to 0 to fully disable use of GD
my $GDinstalled;
BEGIN {
$GDinstalled = eval { require GD };
if ($GDinstalled != 0) {
$use_GD = 1;
}
else {$use_GD = 0;}
}

under that block of code, add:

Code: [Select]
$use_GD = 0;
so it reads:

Code: [Select]
my $use_GD; # set to 0 to fully disable use of GD
my $GDinstalled;
BEGIN {
$GDinstalled = eval { require GD };
if ($GDinstalled != 0) {
$use_GD = 1;
}
else {$use_GD = 0;}
}
$use_GD = 0;


That should do the trick.

Offline isak

  • Newbie
  • *
  • Posts: 6
Re: GD::Image workaround?
« Reply #4 on: October 11, 2006, 09:35:13 AM »
Many thanks... that's the ticket!