A PHP image manipulation class, aimed at generating thumbnails. It features the ability to resize by width, height, and percentage, create custom crops, or square crops from the center, rotate the image, and create Appleโข-style reflections. It also features the ability to perform multiple manipulations per instance (also known as chaining), without the need to save and re-initialize the class with every manipulation.
This class comes in both PHP 4 and 5 flavors, but I highly recommend the PHP 5 version, due to the โ__destruct()โ function that became available in version 5. This helps ensure that you do not inadvertently create memory leaks by forgetting to call the โdestruct()โ function explicitly, like you must in the PHP 4 version of this script.
After the large amount of feedback that I got with the first version of this class, I did a lot of code refactoring, and simplified the API greatly. I have also added some new features:
* You can now create custom crops, as well as square crops from the center of the image
* You can also rotate the image clock-wise or counter clock-wise in 90ยฐ increments
* You can now create those fancy Appleโข-style reflections that are all the rage with the cool โweb 2.0โณ kids!
For the uninitiated, the class still contains itโs old features:
* Works with gif,jpg, and png images
* Ability to resize by percentage, width, or height
* Ability to set quality of jpg images (0-100%)
* Ability to perform multiple manipulations and saves without re-initializing class, or reloading original image
* Ability to display manipulated image on the fly, enabling dynamic image generation in your scripts