Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
I installed ImageAPI 1.6 and got the following error message:
* warning: imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions in D:\DEVELOPMENT\xampp\www\mysite.com\sites\all\modules\imageapi\imageapi_gd.module on line 243.
* warning: imagecolorallocate(): supplied argument is not a valid Image resource in D:\DEVELOPMENT\xampp\www\mysite.com\sites\all\modules\imageapi\imageapi_gd.module on line 267.
* warning: imagefill(): supplied argument is not a valid Image resource in D:\DEVELOPMENT\xampp\www\mysite.com\sites\all\modules\imageapi\imageapi_gd.module on line 267.
* warning: imagecopyresampled(): supplied argument is not a valid Image resource in D:\DEVELOPMENT\xampp\www\mysite.com\sites\all\modules\imageapi\imageapi_gd.module on line 126.
I upgraded to the latest 1.x-dev from 2009-Apr-18 but nothing changed.
I don't know what's wrong. I have a clean installation :: Drupal 6.10, MySQL 5, PHP 5.2.8.
Related modules:
ImageCache :: 6.x-2.0-beta9
Imagecache Profile Pictures :: 6.x-1.0
I also found this issue: #431422: Syntax error in imageapi_gd.module
I was not sure this is the same problem, so I create a new issue.
Thank you in advance.
Stefan
Comment | File | Size | Author |
---|---|---|---|
#6 | Picture 5.png | 123.48 KB | BassPlaya |
#2 | ImageAPI_modules.png | 251.42 KB | design.er |
Comments
Comment #1
drewish CreditAttribution: drewish commentedwhat module is using imageapi? imagecache? does this occur with every image on your site or just one?
if it's just one you've probably got an image that isn't compatible with gd. otherwise i need more detail on what's calling imageapi.
Comment #2
design.er CreditAttribution: design.er commentedThanks for your help.
Attached is a screenshot of all my modules. Primary I use the image modules for profile avaters. When uploading a user picture I get the following error:
The next strange thing is that when I create/edit/delete imagecache actions, I sometimes get the following error:
I can't find any routine/logic there because this error appears by far not every time although I reproduce the same actions in different imagecache presets.
The worst thing is that i.e. the preset "avater_profile" don't save any pictures in the preset folder, so I never see a picture on profiles.
The strangest is, I use the same image modules together on other sites without any problems. I tried 2 absolutely clean installations with the same result.
Regards,
Stefan
Comment #3
drewish CreditAttribution: drewish commentedoh, i meant a copy of the image you're uploading. it wasn't an animated gif file was it?
Comment #4
design.er CreditAttribution: design.er commentedNo, it's a normal jpg image. I use this also on Facebook and Drupal sites where ImageAPI, ImageCache etc. are installed in the same combination and the same versions.
I can upload this image and send a download link via contact form.
Please let me know if you need more information, exports etc.
Is it possible that one of the non-image modules force this errors? ...such as Advanced Forum or Author Pane? I never worked with this modules before. But I think no similiar issues happend up to now, right?
Comment #5
design.er CreditAttribution: design.er commentedI think we can close this issue. On Drupal 6.11 the mentioned bugs never appeared.
drewish, thanks a lot for your help! :)
Best regards
Stefan
Comment #6
BassPlaya CreditAttribution: BassPlaya commentedI have the same problem on Drupal 6.13.
Why is this closed? And what's the solution to this.. I've been reading many similar posts and I'm not using this for the profile avatar but just for uploading a simple image with imagecache, imageapi and cck?
It would be great if someone "who knows the answer" could drop a post about this so that similar users are not spending so much time on effortless searching for the problem..
@design.er: what did you learn from this? What holds you back sharing your solution with us?
Thanx maintainer.
Comment #7
Squidgy CreditAttribution: Squidgy commentedI'm experiencing this same issue, running the 5.x-2.5 version of ImageAPI. Images aren't being generated, and I'm not sure why. #6 - Is your environment IIS as well?
The environment is:
IIS 7
PHP 5.2.10
The errors I'm seeing are:
* warning: imagesx(): 80 is not a valid Image resource in C:\inetpub\wwwroot\clients.bpiw.ca\envision\sites\all\modules\imagecache_actions\watermark.inc on line 25.
* warning: imagesy(): 80 is not a valid Image resource in C:\inetpub\wwwroot\clients.bpiw.ca\envision\sites\all\modules\imagecache_actions\watermark.inc on line 26.
* warning: imagejpeg(): 80 is not a valid Image resource in C:\inetpub\wwwroot\clients.bpiw.ca\envision\sites\all\modules\imageapi\imageapi_gd.module on line 70.
Debugging it, I saw that imageapi_image_open never gets an $image->resource, so I called imageapi_gd_image_open($image); to make sure it did - but it still believes the image resource to be invalid somehow. I can run gd commands on that resource, but it just will not generate anything.
...what's odd is that I'm also running Imagecache 1.x on this same server, which still renders images just fine.
Comment #8
BassPlaya CreditAttribution: BassPlaya commentedI had it fixed by uninstalling the imagecache and image api module from the uninstall page. Clear the caches, via Drupal and in the database. Then reinstall everything.. problem resolved. I can't tell what caused this problem.
Comment #9
s.Daniel CreditAttribution: s.Daniel commentedHad the same error. Tryed uninstalling, reinstalling, flushing caches, checking chmod/chown and couln't get images to show up in views (except for the original) and now after repeating the steps mentioned above it sudenly works. No clue what could've caused the error.
After editing a preset:
On every single page:
Changing back to recent version. (which I used as well)
Comment #10
Upgreydd CreditAttribution: Upgreydd commentedI have the same error, i'm using ImageCache and ImageAPI, just try to change all "resize" actions in imagecache to "scale" that's work for me
Comment #11
johnnymugs CreditAttribution: johnnymugs commentedHey all. Having this same problem. There's a fix here that's working for me so far:
http://tekkie.flashbit.net/drupal/getting-imageapi-and-imagecache-cope-w...
Comment #12
drewish CreditAttribution: drewish commentedso shorter version of johnnybeggs's advice. add
ini_set('zend.ze1_compatibility_mode', 0);
to your settings.php file. i've got no idea if that works though.Comment #13
casey_2000 CreditAttribution: casey_2000 commentedini_set('zend.ze1_compatibility_mode', 0);
IT WORKS. Sometimes it is because of hosting provider.
Comment #14
technicka CreditAttribution: technicka commentedSame issue; I got rid of the "resize" action from my ImageCache preset and it worked.
Comment #15
goodghost CreditAttribution: goodghost commentedAlright, so that is an imagecache module bug. If you choose resize there are two fields, width and height and these are not mandatory, but should be. If you put one value (whatever if it's width or height) and save it, then while generating an image, php functions requires 2 values, 1 for width and 1 for height. And that is why the error is displayed. If you need to set only one value for width or height don't choose "Scale" function, use "Resize" instead. The script will generate the other one (not shown) depending on the first and will display the resized image. As you can see it's all about required fields in scale action which are not but should be!
Comment #16
tomogden CreditAttribution: tomogden commentedFor me this error began when I added another image field to my node, which already had a multi-image field for a slideshow. Removed the second image field, but the problem persists.
I dug through all my imagecache presets, converted everything to 'resize', but to no avail. Emptied caches, ran update.php, entered the "ini_set('zend.ze1_compatibility_mode', 0);" script in my settings.php. No changes.
Comment #17
Rory CreditAttribution: Rory commentedtomogden, I think goodghost means not to choose resize, but Scale instead.
Comment #18
oknateI had the same issue. Tried clearing the cache, didn't work. Then I uninstalled imagecache and reinstalled it. Deleted my preset and recreated it, then it worked.
I think part of the problem was I didn't have the ImageAPI GD2 module enabled the first time, so there was no image toolkit when I enabled Imagecache.