Search code examples
phpmysqlzend-frameworkimage-processingcode-reuse

PHP based image management


A reason I've picked up working with the Zend Framework was that I keep hearing how easy it is to reuse code and not have to reinvent the wheel every time you start a new project. I do find this true for my own code, but find it pretty hard to find quality external sources that can integrate well into the system.

Anyway, I'm basically looking for pre written PHP code (preferably supported by frontend js scripts) that s flexible and wraps the most common tasks relating to image management. (cropping scaling, validation of mimetypes/sizes/dimensions etc) into a useful/flexible class.

Any recommendations?

Thanks


Solution

  • Anyway, I'm basically looking for pre written PHP code (preferably supported by frontend js scripts) that s flexible and wraps the most common tasks relating to image management.

    I'm not sure you're going to find a complete general-purpose drop-it-in component for this, but you can stitch something together without a problem.

    jcrop is a jQuery plugin to handle the client-side bits of image cropping.

    Imagine is a new PHP image handler, wrapping either GD or the Imagick/Gmagick extensions. It has a powerful, convenient, fluent interface with comprehensive cropping, thumbnailing and resizing support.

    As for gluing them together, that'll be up to you... but given that these two libraries can handle most of the work, it should just be some quick bits and pieces in your controller code.