punith
punith

Reputation: 117

What is the difference between Imagemagick and Imagick?

What is the difference between Imagemagick and Imagick ?
How do I configure Imagick to work with IIS and php 5.4.14?

Upvotes: 6

Views: 10120

Answers (5)

DWB
DWB

Reputation: 387

ImageMagick vs Imagick

ImageMagick® is a free and open-source software suite for displaying, converting, and editing raster image and vector image files. It can read and write over 200 image file formats, and can support a wide range of image manipulation operations, such as resizing, cropping, and color correction. -- excerpt from the publisher's site.

ImageMagick may or may not be installed on your system, and was independent of PHP and IIS. While it is a popular image editing program, windows users may be uncomfortable with the absence of a gui; it is mostly run from the command line.

Imagick is the name given by PHP to its extension to ImageMagick. Imagick extends PHP by wrapping or using much of the source code of ImageMagick, but not necessarily the files installed with ImageMagick.

Install Imagick Extension

To enable PHP's Imagick extension for use by a FastCGI module and the PHP CLI, the Imagick PECL package had to be installed. Caveat: instructions herein apply to webservers that use a FastCGI module to call PHP, not a sapi (server) module.

You can start with PHP's windows site, which links to PECL extensions

Use search, or browse >> 'Images', for Imagick, for the link to the Imagick PECL package.

On the PECL package page, links to the windows packages were labelled 'DLL.' Follow the link to the latest package. If you're on the DLL version page, select for your PHP, architecture (x86 32-bit or x64), and thread safety (TS or NTS). FastCGI PHP always needed NTS (non-thread safe). Confirm your requirements with phpinfo.

Download the PECL package and extract it to a folder of your choice, like imagick_php. On windows, it could be 'c:\imagick_php'. Also on windows, imagick_php size could be reduced by 2/3 by moving out or deleting all *.pdb files.

Make imagick_php available to Imagick, by adding the path to imagick_php to a PATH environment variable.

Options: Set system environment PATH variable; makes imagick_php available to software on your system that refers to the PATH variable, including PHP CLI and FastCGI, but requires a reboot.

If you use IIS much more than PHP's CLI, you can share Imagick only with PHP as FastCGI, and without a reboot.

In Administrative Tools > IIS Manager > Server > FastCGI Settings, find the 'application' that corresponds to the site's > Handler Mappings > PHP-FastCGI > Executable. Editing that 'application,' add a variable to the Environment Variables collection: Name path, Value c:\imagick_php;%path%.

Copy the php_imagick.dll from imagick_php to PHP's extension_dir. On windows, it could be 'c:\php\ext'

Instruct PHP to load the Imagick extension on start up. In php.ini, add the line extension = imagick, PHP 7.2+ figures out the path and .dll file name.

Confirm PHP loads Imagick without error. Either browse to a phpinfo file and look for an imagick section, or if your PHP's CLI is setup, set path=c:\imagick_ph;%path% followed by php -d extension=imagick -m, and look for imagick in the list of loaded modules.

Confirm Imagick extension functionality:

Copy examples/captcha.php from imagick_php folder to the webserver site. If on Windows, edit captcha.php, update setFont('Tahoma') or another font on your system.

Finally, browse to the url of captcha.php. Expect a captcha image to be displayed.

Upvotes: 1

REPlummer
REPlummer

Reputation: 121

Side-note, ImageMagick is not a "PHP Utility" it's a command line utility that existed before PHP. It can be used by many programs, or by people directly, to manipulate images.

Wherea Imagick is a native implementation of the ImageMagick API for PHP -- https://www.php.net/manual/en/intro.imagick.php

I know my answers are trivially different, but when it comes to a lot of things (including programming), the devil is in the details.

I unfortunately have no reference for installing PHP with Imagick/ImageMagick on Windows/IIS But I assume the DLL answer to be the correct one.

Upvotes: 9

Xie Jun
Xie Jun

Reputation: 59

For the first question, I think you are asking the difference between ImageMagick (not Image magick) and imagick. PHP Manual gives an explanation http://php.net/manual/en/intro.imagick.php.

For the second question, it is too broad to answer. Maybe you could ask one specific aspect or problem you met.

Upvotes: -1

Annapurna
Annapurna

Reputation: 549

ImageMagick is a PHP utility, a command line tool for image manipulation. For further details, see this.

Imagick is an API or a class that performs the function same as ImageMagick. It provides numerous functions for image manipulation in PHP. Refer to this for more details.

For imagick, you need ImageMagick as well. Run the following command for the same.

sudo apt-get install imagemagick php5-imagick

The installation is well explained with requirements in PHP manual.

Upvotes: 1

Bonzo
Bonzo

Reputation: 5299

Imagick is a php API for Imagemagick.

Find the correct dll, uncomment imagick in php.ini and prepare to spend some time getting it working.

Upvotes: 7

Related Questions