I get this error: The selected image handling toolkit imageapi_optimize can not correctly process imageapi_optimize_image_overlay when I choose an imagecache preset with this actions:
$presets = array();
$presets['mypreset'] = array (
'presetname' => 'mypreset',
'actions' =>
array (
0 =>
array (
'weight' => '0',
'module' => 'imagecache',
'action' => 'imagecache_scale',
'data' =>
array (
'width' => '700',
'height' => '100%',
'upscale' => 0,
),
),
1 =>
array (
'weight' => '0',
'module' => 'imagecache_canvasactions',
'action' => 'canvasactions_file2canvas',
'data' =>
array (
'xpos' => 'left+10',
'ypos' => 'bottom+10',
'alpha' => '90',
'path' => 'sq_plus_32.png',
),
),
),
);
ImageAPI 6.x-1.9
ImageAPI Optimize 6.x-1.x-dev
Imagecache Actions 6.x-2.x-dev
ImageCache 6.x-2.0-beta10
PHP 5.2.10-2ubuntu6.5 with Suhosin-Patch 0.9.7 (cli)
Drupal 6.19
Comments
Comment #1
jcisio commentedThis module supports image_overlay since 1.1, but then replaces it with a more general method. Did you go to the ImageAPI Optimize settings page, click Save after you enable the Imagecache Actions so that it is aware of actions introduced by the latter?
Comment #2
Anonymous (not verified) commentedHi,
sorry for the delay, yes I did what you said, but I get the same error.
Thank you in advance
Comment #3
jcisio commentedI don't have any idea why it happens. Can you check if those values are correct?
cache_get('imageapi_optimize:methods')should return all implemented methods (including overlay). If not, check_imageapi_optimize_get_methods().Comment #4
markus_petrux commentedI have a similar problem with actions provided by ImageCache Actions module, that are located on external .inc files, not present when _imageapi_optimize_get_methods() is invoked. These related functions are loaded by ImageCache module, so a possible solutions would be to do something like this:
Cheers! :)
[EDITED] to fix the order in which the new lines have to be added. They should go before get_defined_functions() is called.
Comment #5
markus_petrux commentedSorry, I forgot to update the issue status.
Temporarily, I'm doing something like that from a custom module and seems to have solved the issue for us.
HTH+
Comment #6
jcisio commentedThat's it! Thanks.
Comment #7
markus_petrux commentedThank you! :)
Comment #8
markus_petrux commentedI'm sorry, my bad, I made a mistake when posting the patch above in #4.
I have edited the code in #4, to fix the order in which the new lines had to be added. They should go before get_defined_functions() is called.
Comment #9
jcisio commentedFixed in http://drupalcode.org/project/imageapi_optimize.git/commit/1e9a538
Comment #10
joran lafleuriel commentedHi all
I am sorry but I couldn't get an overlay action, even if I use the last version where #9 is commited.
Here is what I can read in /var/log/syslog for each image :
Parameter 2 to imageapi_imagemagick_image_overlay() expected to be a reference, value given in my/path/to/modules/imageapi_optimize/imageapi_optimize.module on line 162.action(id:57): canvasactions_file2canvas failed for sites/default/files/my_image.jpgFailed generating an image from my_source_image using imagecache preset my_imagecache_presetThis looks like a PHP 5.3 issue...
My config : Ubuntu 11.04, Drupal 6.20, ImageMagick 6.6.2-6, ImageCache 6.x-2.0-beta12, ImageCache Actions 6.x-1.8
Thanks !
Comment #11
jcisio commentedI've looked quickly at imagecache_actions module http://drupalcode.org/project/imagecache_actions.git/blob/refs/heads/6.x... and the second parameter is passed by reference. Its signature is different from other actions (where only the first, &$image, is passed by reference).
One solution could be: clone from imageapi_image_overlay to imageapi_optimize_image_overlay. In L21 imageapi_optimize.module, check for function existence before defining new one. It should work, but I can't test now (don't use imagecache_actions, so it'd take time to test).
Comment #12
jcisio commentedComment #13
mrfelton commentedI get a similar error, but for imagecache_scale_and_crop
Comment #14
gionnibgud commentedSame here for imageapi_optimize_image_resize
Comment #15
mstrelan commentedI get this error for any styles. Trying to use Yahoo! Smush It because jpegtran is outside of my open_basedir().
Error message:
The selected image handling toolkit imageapi_optimize can not correctly process image_imageapi_optimize_get_info.
Comment #16
PuntoAndroid commentedSuscribing same isse mstrelan and others mention. This would be a great module! I hope i can adress the issue and fix it.
Comment #17
azinck commentedAs to the issue mentioned in #15 and #16: I'm thinking we need the following on line 303 (at the top of _imageapi_optimize_get_methods() ).
module_load_include('inc','system','image.gd');Comment #18
esbite commentedI also got the error message described in #15. Properly clearing the cache after saving the settings under Image Toolkit solved it for me.
Comment #19
lyricnz commentedThe suggestion in #17 is on the right track - imageapi_optimize is not getting a full list of available image_gd_* methods because the GD include file isn't loaded. This was fixed in #1714742: The selected image handling toolkit imageapi_optimize can not correctly process.
Comment #20
-Mania- commentedThanks #18, clearing the caches removed the errors.