Today I have tried to install imagick
in my xampp a hundred times. And I did it. If you have troubles, please try following these steps:
- Since xampp is x86, check if your Image Magick (the program) is x86. If not, download the latest version here: imagemagick.org/script/binary-releases.php#windows
Please remember that u MUST download the
Win32 dynamic at 16 bits-per-pixel
. - Install Image Magick at
C:\imagemagick
. - Download the latest stable version of imagick here: . You MUST download the
5.x Thread Safe (TS) x86
. The x in 5.x is the version of your PHP. - Put the
php_imagick.dll
in php/ext folder of your xampp installation. - Add this in your php.ini:
extension=php_imagick.dll
- Here is when I have a lot of trouble. If you try to start the server (or writing
php
in the console (start->cmd)), you will get an error. If that error says something like this:Unable to find the entry point for the procedure FlattenImages in the DLL CORE_RL_magick.dll
it means that you're well underway. - Now, you must go into the installation folder of Image Magick and overwrite the DLL you downloaded with the
php_imagick.dll
. All of them start with the prefixCORE_RL_
. - Once you overwrote all of them, you can try writing
php
in the windows console. I don't say something means that the imagick is functional (you can check inlocalhost/xampp/ > phpinfo() link
. Personally, I had to install a new DLL:vcomp110.dll
. If someone has the same error as me (the system can't found thevcomp11.dd
) download it here
Now, if you try executing php
on console, or just initializing the apache module of xampp, you should not have errors.
Goodbye and hope I can help someone.
EDIT: when tried to convert some-img.bmp some-result.jpg
in the console, I had this error:
convert.exe: unable to open module file 'C:\Users\my-acc\.magick\IM_MOD_RL_BMP_.dll': No such file or directory @ ...
This happened when there is no folder .magick
in my-acc
. The thing you need to do is this:
Create a folder named
.magick
in themy-acc
folder. Since the name starts with a stop, you need to create it through the console. Here are the commands:1.1.
c:
1.2.
cd Users\my-acc
1.3.
mkdir .magick
Go to
C:\imagemagick\modules\coders
and copy the entire files into the latest folder created.
Now, you will be able to use Image Magick through the commands or the PHP Classes.
On background, if you use Codeigniter, i have no idea how to use the image_lib with imagick. So, it's better with the own imagick classes. Here a simple example:
$image = new Imagick($upload_data['full_path']);
$image->thumbnailImage(250,0);
if($image->writeImage($upload_data['file_path'].$upload_data['raw_name'].'_thumb'.$upload_data['file_ext'])){
something here;
}
$image->clear();