THESE CODES ARE PROVIDED FOR AN EXAMPLE OF HOW TO USE IMAGEMAGICK WITH PHP. CARE SHOULD BE TAKEN WHEN ACCEPTING USER INPUT.
I TAKE NO RESPONSABILTY FOR ANY PROBLEMS THAT MAY OCCURE WHEN USING ANY OF THIS CODE.
IT IS UP TO YOU TO SECURE THE CODE AND VALIDATE USER INPUT.
ImageMagick is an external program that can be called from php and in the following pages you can find some examples, tips and tricks on how to use it with php.
There are APIs to use ImageMagick but I tend to use the php exec() function along with the command line method as I find it gives more flexibility and uses the full range of options.
I have also included a few examples of the GD library that is built into php and one of the php APIs called Imagick which is also built into the later versions of php.
Do not confuse Imagick with ImageMagick !
Imagemagick version 7 is basically the same as version 6 but it has a few differences: