I struggled a long time to find how to use ImageMagick rather than the default GD2 image toolkit.
By looking at the code, I finally discovered that the Image Handling collapsible section in /admin/settings was not there because it was commented out (after ligne 356) in system.module.
This disabling was done at revison 1.236 (Patch #29465) during the conversion to the new form API.
I have just suppressed the /* and */ but another error appeared:
Invalid argument supplied for foreach() line 275 of file /homepages/6/d146951710/htdocs/Drupal/includes/form.inc..
As I am not yet very good in PHP and Drupal APIs, I am unable to fix that problem.
Thanks for your help.
Comments
Comment #1
owen barton commentedI am raising this to critical unless someone can verify that either:
a) We no longer support ImageMagick
- or
b) ImageMagick works without the commented code (below).
- or
c) We need to fix this before release
In either (a) or (b) we might want to think about removing the code before release.
Also, if anyone can dig up links to the original patches so we can figure out more about what this code was breaking that would be great.
Here is the code in question:
Comment #2
Montuelle commentedI would like to be able to try ImageMagick because I have the following problem with GD2 each time I try to save any image (which is indeed a JPEG file):
Googling around it seems that this problem with imagecreatefromjpeg() may be due to the version of GD2 that my Internet Provider (1and1) offers.
I have installed Gallery2 on the same site and I have no problem with the resizing of images. Certainly Gallery2 uses a different function than image.inc for the resizing.
Comment #3
merlinofchaos commentedHere is a theoretical patch. I can't test this for sure because I don't have imagemagick installed.
Someone who has both gd and imagemagick installed, please test?
Comment #4
chx commentedComment #5
Montuelle commentedSummary:
OK for the patch ..... but I have to find out now what is not working in my ImageMagick installation.
So if somebody else (having already ImageMagick working) could try also to be sure.
Details:
I have applied the patch. The "Image Handling" collapsible section in /admin/settings is now visible with a choice between ImageMagick and GD2 toolkits. GD2 is the default. I have chosen ImageMagick and saved the settings. I created an image. 2 error messages: derivatives cannot be created. I went back to the settings, selected GD2 and saved. I created another image. Error messages from imagecreatefromjpeg() already mentionned above.
So for me the patch works. Thanks again Merlin.
The messages I got with GD2 have certainly nothing to do with Drupal (except if image.inc was using exactly the same procedure as Gallery2 I may not have the problem).
I have no specific messages from ImageMagick, just 2 messages from Drupal that the derivatives could not be created. As I had to install ImageMagick myself (not provided by 1and1) and I found the installation rather complex, I am not surprised to have such a problem. I will continue to investigate.
Comment #6
chx commentedIf you were not getting a watchdog message "The selected image handling toolkit '%toolkit' can no
t correctly process '%function'." then please set ready to be committed because then this patch works.
Comment #7
Montuelle commentedI got no error messages in my watchdog log during my test above. I agree the patch works.
Comment #8
Stefan Nagtegaal commentedI can confirm this patch does work! Should get in ASAP IMO, because ImageMagick gives us more flexibility and speed todo some fancy thumbnail generation.. (Believe me! :-))
So indeed, this is ready to get in...
Comment #9
dries commentedCommitted to HEAD. Thanks.
Comment #10
Montuelle commented