Forum Moderators: coopster

Message Too Old, No Replies

How to install ImageMagick for PHP?

It's so hard to install this.

         

cosmoyoda

8:40 pm on Dec 25, 2007 (gmt 0)

10+ Year Member



Hello,

Many of you know may know about a certain function library for PHP called ImageMagick or Imagick. It's amazing! I can create images and manipulate them easily on my server and even create image thumbnails, etc. However, I can't install this, it's too hard. I'm using Mac OS X to test my website using MAMP and my Web Hosting provider uses UNIX.

The problem is the installation, I don't know how to install this. Do you know how I can accomplish this?

Thank you in advance!
Cosmoyoda

coopster

2:28 pm on Dec 26, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



ImageMagick is a very popular open source system and actually quite easy to install, at least in my experiences, which I must admit have not yet been on a Mac. There are, however, step-by-step installation instructions on how to do so on the open source project's web site:

[imagemagick.org...]

In the left hand menu you will find the Binary Releases for Mac OS X.

cosmoyoda

2:19 am on Dec 27, 2007 (gmt 0)

10+ Year Member



Thank you coopster, I've finally managed to install ImageMagick on my system.

However, I don't know how to use it inside my PHP code. How do I call a specific function and do cool stuff, like drawing circles, ellipses and even give a certain blur to my images? Create thumbnails, rotate images, etc?

I tried reading the PHP.net ImageMagick manual, but it's incomplete. Any ideas?

Thank you.

coopster

2:36 am on Dec 27, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



The PHP "Imagick" Image Library [php.net] extension is EXPERIMENTAL. You are likely best to create yourself an extraction layer that handles the manipulation for you until things work the way you expect. What that means is you should create a script that does your image manipulation using the functions you have defined that you can update/alter later if necessary/desired.

For now, that may include using Program Execution Functions [php.net] to get the job done.

cosmoyoda

6:37 am on Dec 27, 2007 (gmt 0)

10+ Year Member



It seems like using ImageMagick with PHP requires lots of programming skills, which I am not yet good enough to understand.

However I just acquired a book that will teach me how to use ImageMagick with PHP and learn how to use the command line, the convert utility, etc. But for now, I can't create rounded corners dynamically for my website the way I wanted to because I've got to read this manual first.

If I'm lucky enough soon PHP.net will have a fully documented version of the ImageMagick Function Library and that shall help me achieve all these image tasks easily with neat PHP code =)

Thank you so much for all your help!