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.
- Unable to generate the derived image located at....
- The selected image handling toolkit imageapi_optimize can not correctly process image_imageapi_optimize_get_info.
I am getting these two errors with the D7 dev branch.
I'm running the latest D7 with ImageAPI dev (from 25th Feb)... ImageMagick 7.x-1.0-alpha2.
I get the following errors in admin...
Warning: Division by zero in theme_image_style_preview() (line 769 of /var/www/html/drupal7/drupal/modules/image/image.admin.inc).
Warning: array_intersect_key(): Argument #1 is not an array in theme_image_style_preview() (line 771 of /var/www/html/drupal7/drupal/modules/image/image.admin.inc).
Warning: Division by zero in theme_image_style_preview() (line 786 of /var/www/html/drupal7/drupal/modules/image/image.admin.inc).
Warning: array_intersect_key(): Argument #1 is not an array in theme_image_style_preview() (line 788 of /var/www/html/drupal7/drupal/modules/image/image.admin.inc).
Investigating...
Comments
Comment #1
nicholasThompsonThe problem exists between GD and ImageMagick too...
I have optipng and jpegtran enabled. The problem exists even if I remove all of these...
EDIT: Also get an error with Yahoo SmushIt too...
Comment #2
nicholasThompsonIf it makes any difference - I'm running nGinx 0.7. If I disable ImageAPI Optimize, my styles generate properly so I dont *believe* its a configuration issue...
Comment #3
nicholasThompsonHmm.. So emptying cache made a difference. Seems to be working now.
I'm wondering if the hook_init implementation doesn't quite work correctly if the module is enabled during "drush en"?
I'm not entirely sure what the purpose of this is... Is it to dynamically generate functions?
Comment #4
jcisio CreditAttribution: jcisio commentedOther modules, like imagecache_actions, are implemented as if there are only 2 toolkits (D6): gd and imagemagick. That piece of code is from #852860: Support imageapi actions implemented by other modules and it does what you said. The patch in that issue is fairly self-explained.
Comment #6
vlajkop CreditAttribution: vlajkop commentedI had exactly the same error messages on my developer machine and as I figured problem was in permissions setting for folder /path-to-your-drupal-web-folder/sites/default/files/styles/. Owner of styles folder was my linux local username instead of www-data (Apache web server). I'm guessing this was missconfigured during drupal 7 installation or core update since this was the only affected folder under /sites/default/files/.
After changing ownership and leaving permissions to drwxrwxr-x problem was solved and all subfolders needed for media library and thumbnails were created. Also submitting settings for images in /admin/config/media/image-styles to overwrite default theme settings didn't hurt.
Comment #7
nicholasThompsonFor my own future reference...
You need to use: http://drupal.org/project/imagemagick
The module bundles with ImageAPI (imageapi_imagemagick.module) doesn't contain the get_info() function.
Solution: Enable the ImageMagick module, save the Image Toolkit settings page and flush cache...
Comment #8
dieppon CreditAttribution: dieppon commentedYou were right, I changed the permissions and flushed the caches and all the thumbnails were rebuild and the errors disapeer, thanks!
Comment #9
codesidekick CreditAttribution: codesidekick commentedI've done all the comments suggested above. Uninstall, reinstalled, enabled with drush, enabled with admin, CHMOD'd file directories etc. Just trying to use it with Yahoo Smushit but I'm getting the same two PHP errors as in the top post. It's pretty much a fresh install but I'll try it with a totally new Drupal install and see if it fixes it and let you know.
Comment #10
RaulMuroc CreditAttribution: RaulMuroc commentedAnd which where the results of @martysnow?
The same problem, getting:
Unable to generate the derived image located at public://styles/public... which all permisions correct (even with 777). And is curious because in the directory styles there are Style1 and Style2 sub-folders and into Style1 the pictures are greatly created and in Style2 is where they are not created... and both folders has the save permissions.
Comment #11
codesidekick CreditAttribution: codesidekick commentedI didn't get anywhere on this and elected not to use the module unfortunately. Opted to do most of my image styling with CSS instead and force JPGs on the user to get around the whole PNG's are huge issue.
Comment #12
jcisio CreditAttribution: jcisio commentedNothing new. Revert the status.
Comment #13
brylie CreditAttribution: brylie commentedWe are getting this error on a D7.16 install, even with standard image names (no special characters).
"Unable to generate the derived image located at public://styles/thumbnail/public/..."
Our setting for public images folder seems to be correct.
The following page displays a rotating block on the right hand side:
https://www.friendlywater.net/projects/mutaho
Each item in the block is supposed to, and used to, display an image of the person. Instead, a generic image holder appears. When I copy the image source into the URL bar, I get the following error:
"Error generating image."
See: https://www.friendlywater.net/sites/friendlywater.net/files/styles/thumb...
We are running:
PHP 5.4.3
Drupal 7.16
Comment #14
jcisio CreditAttribution: jcisio commentedDid you try to get a more verbose error message?
Comment #15
corey.aufang CreditAttribution: corey.aufang commentedI was also getting this error after installing the module using Drush.
A quick flush of the cache resolved the issue.
Comment #16
jcisio CreditAttribution: jcisio commentedRevert the title again because of #15.
Comment #17
grkm2002 CreditAttribution: grkm2002 commentedI'm getting the following errors. Unable to get any image preview. Using Drupal 7.19 with imagemagic.
I've already flushed my cache and still get the same problem. Can anyone provide any help?
Comment #18
cfox612 CreditAttribution: cfox612 commentedI'm also getting these errors. I've flushed my cache multiple times, and insured that the directory permissions are set to 777.
Comment #19
achtonI can confirm that flushing the cache fixes this issue, with 1.0 and dev version. ImageMagick is installed also FWIW. No configuration changes could fix it, nor deleting all image style folders. Only clearing cache worked.
Comment #20
Melissamcewen CreditAttribution: Melissamcewen commentedI had this issue too and fixed it by going to the settings and selecting at least one binary in "Internal tools". This could probably be solved by have a default binary if this is indeed the cause for much of this.
Comment #21
hashtivist CreditAttribution: hashtivist commentedguys, just specify the path to your binary.
4 ubuntu : /usr/bin/convert