PHP class using Imagick – resize, reflect or drop shadow

Imagick used to generate reflectionI’ve been spending a bit of time getting to know PHP classes over the Christmas holiday, and I’ve written a couple to test out my knowledge.
The first is an image uploading class, which checks for various problems with files prior to moving them to a destination directory. It checks:

before moving the file. The next class gives various options for manipulating the image, resizing, rounding corners, adding a reflection etc. all using the Imagick class, which is installed with php5-imagick (available from the ubuntu repos and other reputable linux software emporiums!). The reflection and drop shadow parts of the class owe a great deal to Mikko Koppanen who provides some great Imagick examples and code snippets on his blog. I’ve uploaded the classes, including an index file that can be used as an example in the absence of proper documentation!

I’ve uploaded a working version of the test files shown below as a demo to a website of mine: try it here.

Available to dowload as a zip archive including the four empty directories the example script needs to run. Any suggestions for improvement gladly received.

Posted on January 6, 2009 at 3:19 pm by mcmlxxii · Permalink
In: Linux · Tagged with: , , , , , , , , ,

2 Responses

Subscribe to comments via RSS

  1. Written by gilou
    on 31/01/2010 at 9:33 pm
    Permalink

    Download is dead dude !

  2. Written by mcmlxxii
    on 01/02/2010 at 8:50 pm
    Permalink

    Oops – fixed.

Subscribe to comments via RSS

Leave a Reply