When I submit an node with an image uploaded, cropped, and ready to go, I get the following error message.

    * warning: imagecopyresampled(): supplied argument is not a valid Image resource in /www/docs/drupal/sites/cct/modules/imagefield_crop/imagefield_crop.module on line 598.
    * warning: imagedestroy(): supplied argument is not a valid Image resource in /www/docs/drupal/sites/cct/modules/imagefield_crop/imagefield_crop.module on line 626.

Is this reproducible by anyone else?

Comments

chromix’s picture

Some handy information about my setup:

Drupal 5.5
MySQL 5.0.41
PHP 4.4.1
GD Library 2.0.28 compatible
JQuery 1.1.2

yhager’s picture

Status: Active » Postponed (maintainer needs more info)

Can you upgrade your PHP version to 5.2?

chromix’s picture

So you're telling me this only runs on PHP version 5.2? :-)

Unfortunately I can't upgrade. Is there any way around the code that requires 5?

yhager’s picture

Status: Postponed (maintainer needs more info) » Active

I am not telling that, I just wanted to know if this is the problem.
The functions from the error message should work the same with PHP 4 and 5, so I think the problem is elsewhere (some other piece of code is sensitive to PHP's version, or another problem in your env, or a bug in the module..).
My environment is PHP 5, so it's hard for me to test on PHP4. If I ever get to have a PHP4 env for testing, I'll update here.

In the meantime, consider heavily the ugprade (see http://gophp5.org).

(All this does not mean it is a PHP version problem, it is my best guess at the moment though).

Have you tested imagefield without imagefield_crop? Does that work as expected?

chromix’s picture

All my Image fields are still working on the nodes i have set up, so that eliminates a problem with Imagefield.

I was able to duplicate the same problem on a stripped down instance of Drupal on the same server. That eliminates the possibility of a module conflict, so it seems more like PHP 4 might be behind the problem.

Can anyone else confirm this?

yhager’s picture

Status: Active » Postponed (maintainer needs more info)

Looking at the code I can't see any reason why it would fail on PHP4, but the only test is to actually debug it in this env. If anyone can shed more info it will be appreciated.

chromix’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

It turns out the GD lib version we were running on our development server didn't have JPEG support installed. Now that we've fixed that everything seems to be working.