Once fixed the Undefined index: #post in imageapi_imagemagick_validate_path() issue, ImageMagick toolkit is still not working on Drupal 7.0 beta 3, 2010-11-13.
When clicking on any style in Administration/Configuration/Media/Image styles, the following message is displayed :
Warning: Division by zero in theme_image_style_preview() (line 772 of /srv/principal/www/d7/modules/image/image.admin.inc).
Warning: array_intersect_key(): Argument #1 is not an array in theme_image_style_preview() (line 774 of /srv/principal/www/d7/modules/image/image.admin.inc).
Warning: Division by zero in theme_image_style_preview() (line 789 of /srv/principal/www/d7/modules/image/image.admin.inc).
Warning: array_intersect_key(): Argument #1 is not an array in theme_image_style_preview() (line 791 of /srv/principal/www/d7/modules/image/image.admin.inc).
No image is displayed. Clicking on effect result "view actual size" link, I get a "Error generating image." page.
This problem is due to lacking image_imageapi_imagemagick_get_info function in ImageMagick toolkit. This function is used by drupal to get image size.
Here is a patch which :
- Adds a image_imageapi_imagemagick_get_info function using the identify binary from ImageMagick,
- Adds a field in the configuration form for the identify path,
- Fixes the Undefined index: #post in imageapi_imagemagick_validate_path() issue.
This is not perfect, there is still some missing things like checking the identify path but before going further I wanted to have some opinions about it.
Comment | File | Size | Author |
---|---|---|---|
#11 | missing_image_info.patch | 9.34 KB | pyrollo |
#8 | imageapi-989130-8-missing_image_info.patch | 9.33 KB | Mark Trapp |
#1 | missing_image_info.patch | 9.32 KB | pyrollo |
missing_image_info.patch | 5.22 KB | pyrollo |
Comments
Comment #1
pyrollo CreditAttribution: pyrollo commentedHere is a new version of the patch, including path and version test for "identify".
Comment #2
pyrollo CreditAttribution: pyrollo commentedI tested issue and patch on drupal 7.0-rc2 today.
Issue is still there and the patch is still solving it.
Comment #3
Aeonius CreditAttribution: Aeonius commentedI am getting the same error. I have to install patches manually due to shared hosting. Where is this file located? I simply can't find "cvs/drupal-contrib/contributions/modules/imageapi/imageapi_imagemagick.module" In my Drupal folder I have the following:
-includes
-misc
-modules
-profiles
-scripts
-sites
-themes
Thank you
Comment #4
pyrollo CreditAttribution: pyrollo commentedThis file is located in one of your modules directory, depending on where you installed the imageapi module (either modules, sites/all/modules, sites/default/modules or sites/yoursite.com/modules). The precise location is then : modules/imageapi/imageapi_imagemagick.module .
Comment #5
Aeonius CreditAttribution: Aeonius commentedI am such a tool. I searched the error on Google and ended up here. I totally forgot to check which module this issue was about, I just matched the error with the one I got (also on that same line...), but I do not have the imagemagic module installed. Anyway, the error seems to have vanished into thin air. I hope it stays that way. Thank you for your quick response! Sorry to waste your time.
Comment #6
Mark TrappBeen using the patch in #1 extensively for the past 2 weeks: works as described. Implementing
imageapi_imagemagick_get_info()
is required forimage_load()
as well.Comment #7
fietserwinWorks here as well (Windows Vista)
Comment #8
Mark TrappRerolled patch to correct minor coding standards issues and remove extraneous whitespace.
Comment #9
crysaz CreditAttribution: crysaz commentedPatch works so far, but it breaks filenames containing spaces.
Comment #10
Mark TrappCan confirm. Will look into fixing that later today.
Comment #11
pyrollo CreditAttribution: pyrollo commentedHere is a fixed patch.
That was a silly mistake, I forgot to escape file name in the identify command. The only difference with the previous patch is a call to escapeshellarg in line 110.
Comment #12
adrinux CreditAttribution: adrinux commentedWorks for me. Errors gone and now able to use imagemagick :)
Comment #13
sunThis has been fixed in http://drupal.org/project/imagemagick already
Comment #15
@Kambiyaso CreditAttribution: @Kambiyaso commentedHi Pyrollo
I applied the patch as stated but I am still getting the errors:
Warning: Division by zero in theme_image_style_preview() (line 804 of /Applications/XAMPP/xamppfiles/htdocs/maji_new_site_wcdt/modules/image/image.admin.inc).
Warning: array_intersect_key(): Argument #1 is not an array in theme_image_style_preview() (line 806 of /Applications/XAMPP/xamppfiles/htdocs/maji_new_site_wcdt/modules/image/image.admin.inc).
Comment #16
axlroach CreditAttribution: axlroach commentedHi @Kambiyaso,
Did you try checking to make sure the sites/default/files/styles directory (and all the directories beneath it in the file structure) has write permissions?
Comment #17
cayerdis CreditAttribution: cayerdis commentedI had this problem too because I did not have the right permissions for sites/default/files
Comment #18
nicodv CreditAttribution: nicodv commentedSame here, the problem was permissions on the sites/default/files/styles directory
Comment #19
cllamas CreditAttribution: cllamas commentedI have 775 in files and files/styles
I have owner and group _www (OSX).
But still doesn't generate styles. (I actually had to create files/styles myself)
Comment #20
leymannxHad to
sudo chmod -R 777 files/
since some images I uploaded had wrong permissions.