UnableToLoadModule IM_MOD_RL_JPEG_.dll with ImageMagick
Posted by: FireDart (---.res.bhn.net)
Date: July 04, 2014 09:23PM

Hello,
I'm having some trouble getting ImageMagick to work on the latest version of WampServer. I managed to get it "working" to a point were it is loaded and can be seen in phpinfo() however I keep getting this error:

Fatal error: Uncaught exception 'ImagickException' with message 'UnableToLoadModule `C:\imagemagick\modules\coders\IM_MOD_RL_JPEG_.dll' in */test.php on line 6

When I try running this code:
$im = new Imagick();
$im->readImage('test.jpg');
$im->thumbnailImage(150, null);
$im->writeImage('thumb.jpg');
$im->destroy();

My current environment:
OS: Windows 7
WampServer: 2.5
Apache: 2.4.9
PHP: 5.5.12

I think it's a compatibility issue but I'm a bit lost at what I should do to fix it.

I'll try to recreated everything I did and some ideas why it's not working, perhaps I'm missing something.

1) Installed the latest WampServer (version 2.5 / 64bit)

2) Install the latest ImageMagick binary (ImageMagick-6.8.9-5-Q16-x64-dll.exe) again 64bit version into c:\imagemagick

3) Set an environment variable MAGICK_HOME inside of Windows 7 with a value of C:\imagemagick\modules\coders

4) I then downloaded the thread safe 64 bit version (5.5 Thread Safe (TS) x64) of the PECL ImageMagick dll's at: [pecl.php.net]

5) Placed php_imagick.dll dll into the C:\wamp\bin\php\php5.5.12\ext and all the `CORE_RL_*.dll files into the C:\wamp\bin\apache\apache2.4.9\bin.

6) Located the active php.ini file and added the extension=php_imagick.dll

When I load phpinfo() I get that imagick is enabled and running this in php also confirms that it working:

if(extension_loaded('imagick')) {
echo 'Imagick Loaded';
} else {
echo 'failed';
}

However! I think this might be the issue, my imagick module version is 3.1.2 and the ImageMagick version is ImageMagick 6.8.8-4 Q16 x64.

This does not match up with the ImageMagick binary I downloaded: ImageMagick-6.8.9-5-Q16-x64-dll.exe.

The exe is 6.8.9-5 and the version of the dlls is 6.8.8-4 so I'm assuming it is a compatibility issue, however, what am I to do, older binaries are not provided and I don't want to download 3rd party.

Also most tutorials redirect to [valokuva.org] for files which does not help as the site has been wiped and all that is present is the nginx homepage.

Also the IM_MOD_RL_JPEG_.dll that php is claiming does not exists does exist in C:\imagemagick\modules\coders.

I'm also thinking it might be an issues with Visual Studio version as the new WampServer is using VC11 and I think ImageMagick might be using VC10 but I'm not 100% sure + I'm don't really understand VC very well.

Any ideas? Been scratching my head with this for a few days looking for an answer.

-Julian

Options: ReplyQuote
Re: UnableToLoadModule IM_MOD_RL_JPEG_.dll with ImageMagick
Posted by: RiggsFolly (---.dynamic.dsl.as9105.com)
Date: July 05, 2014 12:53AM

Well VC11 should load VC10 compiled modules ( officially !!)

I done have a MAGICK_HOME but I do have D:\wamp\ImageMagick-6.8.7-Q8; on my path which is where I installed imageMagick

Is that any help?

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: UnableToLoadModule IM_MOD_RL_JPEG_.dll with ImageMagick
Posted by: FireDart (---.res.bhn.net)
Date: July 05, 2014 03:49PM

I installed ImageMagick in C:\imagemagick and originally tried making the MAGICK_HOME variable to that location, later found a tutorial that suggested pointing to the modules\coders folder (C:\imagemagick\modules\coders) and that actually made imagick load.

What I don't understand is that IM_MOD_RL_JPEG_.dll exists in the modules\coders folder yet it is saying it does not exists.

Options: ReplyQuote
Re: UnableToLoadModule IM_MOD_RL_JPEG_.dll with ImageMagick
Posted by: RiggsFolly (---.dynamic.dsl.as9105.com)
Date: July 05, 2014 04:25PM

Can you run your image conversion from the command line?

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: UnableToLoadModule IM_MOD_RL_JPEG_.dll with ImageMagick
Posted by: FireDart (---.res.bhn.net)
Date: July 05, 2014 08:50PM

Yes, tried a similar command to see if it was a specific issue but nope, seems to be WAMP/PHP/ImageMagick issue.
> convert test.jpg -resize 150x150 thumbnail.jpg

Can I ask what permissions you have for the folder? Wondering if maybe it can't read it because it does not have sufficient permissions.

Besides that I'll take any advice at this point.

Options: ReplyQuote
Re: UnableToLoadModule IM_MOD_RL_JPEG_.dll with ImageMagick
Posted by: RiggsFolly (---.dynamic.dsl.as9105.com)
Date: July 07, 2014 09:57AM

Permissions are almost never the issue on windows unless you use some very specific and tailored access control.

Check the Event log, that can be very useful in odd situations like this.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: UnableToLoadModule IM_MOD_RL_JPEG_.dll with ImageMagick
Posted by: FireDart (---.res.bhn.net)
Date: July 18, 2014 03:49AM

Sorry to dig up a some what old problem but I decided to do some more testing on my free time a learned a few things.

1) Tested again to make sure but I can still convert jpg's via the terminal/cmd
2) Tried converting a gif in my php code like so:
$im = new Imagick();
$im->readImage(dirname(__FILE__) . '/test.gif');
$im->thumbnailImage(150, null);
$im->writeImage(dirname(__FILE__) . '/thumb.gif');
$im->destroy();

and it worked just fine.
3) Tried using the exec command in my php for a jpg and it works fine!
exec("convert test.jpg -resize 50% thumb.jpg" );

For some reason it can't find C:\imagemagick\modules\coders\IM_MOD_RL_JPEG_.dll but it can find IM_MOD_RL_gif_.dll.

With this info could you en-light me with any more ideas? Why would only some dll's work and not others?

Also checked the logs and nothing of value :/

Options: ReplyQuote
Re: UnableToLoadModule IM_MOD_RL_JPEG_.dll with ImageMagick
Posted by: RiggsFolly (---.dynamic.dsl.as9105.com)
Date: July 22, 2014 11:40AM

Do a google on

'imagick IM_MOD_RL_JPEG_.dll'

there appears to be some specific issues with that dll from a imagick point of view in some edge cases.

Maybe try a very simple jpeg, see if it will convert that.

I would imagine that it is in fact looking for some other dll from within IM_MOD_RL_JPEG_.dll and you may have to build it yourself, judging from what I read using the above google search.

Its quite common for dll's that cannot find other dll's to report the error as being from themselves and not the correct error saying it cannot find something else it requires!

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote


Sorry, only registered users may post in this forum.