Hi guys,
I got this when trying to set a .gif file as watermark:
warning: imagecopymerge(): supplied argument is not a valid Image resource in .../public_html/drupal/sites/all/modules/imagecache_effects/imageapi.inc on line 90.
And this when trying to set a .png file as watermark:
* warning: imagealphablending(): supplied argument is not a valid Image resource in .../public_html/drupal/sites/all/modules/imagecache_effects/imageapi.inc on line 85.
* warning: imagealphablending(): supplied argument is not a valid Image resource in .../public_html/drupal/sites/all/modules/imagecache_effects/imageapi.inc on line 86.
* warning: imagecopy(): supplied argument is not a valid Image resource in .../public_html/drupal/sites/all/modules/imagecache_effects/imageapi.inc on line 87.I already tried to modify $image->res to $image->resource but still didn't work.
Can anyone please fix it?
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | imagecache_effects.zip | 12.08 KB | kamkejj |
Comments
Comment #1
binhcan commentedAdditionally, I tried .jpg and the same error as .gif
:((
Comment #2
RAFA3L commentedsame here
Comment #3
mpaler commentedSame for reflection.
My system info:
ImageAPI 6.x-1.6
ImageCache 6.x-2.0-beta9
PHP 5.2.5
GD Version bundled (2.0.34 compatible)
UPDATE: Fixed this problem...
The problem (for both watermark & reflection) is the image resource reference in the image object. It needs to point to "resource" not "res". Not sure why it's pointing to "res" as this is clearly not the correct reference as per the php function documentation.
To fix the watermark (please note my system above), you need to change all references, including to marker as following:
Same thing for reflection -- change all references to "res" in function imageapi_gd_image_reflection...
I'm not writing a patch because I think we need to know more about this "res" "resource" issue.
Comment #4
off commentedI dont see errors, but imagecache action dont work if in it adds the task "add watermark"
Comment #5
flexator commentedfor me the same error on watermark and reflection and your "patch" did not work.
Comment #6
loze commentedI had these errors, the above fixed it for me.
replacing every instance of $marker->res and $image->res with $marker->resource and $image->resource respectively
in imageapi.inc
Comment #7
jjjames commentedsame problem here...any plans on an update?
thanks for the great module!
Comment #8
eldesigner commentedPatch worked for me. Thanks for the great module! It's saved me SO much time.
Comment #9
codigovision commentedthe replacement worked for me too, Thanks!
Comment #10
kamkejj commentedHere's a zip file with the entire module, but with every instance of *->res changed to *->resource in imageapi.inc. This fixed the errors I was getting that were that same as described here.
Comment #11
DocMartin commentedthanks, kamkejj!
- took a bit of searching to find this thread and your fixed module (I'd been trying to create reflection)
Comment #12
okkingaj commentedI spent an entire afternoon trying to get reflection to work. Thanks for this solution Kamkejj!!
Comment #13
catofcheshir commentedNow with this changes it works for me. Thanks!
Comment #14
lukusThe fix worked for me too - great work. Thanks.
Would it be possible to add this to the release?
Comment #15
torgospizzaThe fix detailed in #3 also worked for me, using the latest versions of these modules and PHP 5.2.4-2ubuntu5.19.
Comment #16
hollybeary commentedthe above .zip works for me as well, thank you so much!