PHP Image Manipulation Class can be used to perform several types of image manipulation operations. It can rescale images to fit in a given width or height keeping (or not) the original aspect ratio, flip images horizontally or vertically, and rotate images by a given angle while filling the empty spaces with a given color. All operations preserve transparency. The class does all the error checking for the source and target files. The class supports loading and saving images in the GIF, JPEG, and PNG formats.
| Tags | Software Development Libraries php classes |
|---|---|
| Operating Systems | OS Independent |
| Implementation | PHP |
Recent releases


Changes: A bug was fixed where the resize() method would produce unexpected results when the actual width of the image was smaller than the value of the resizeToWidth property and resizeIfSmaller property was set to FALSE. In this case, if the height of the image was to be adjusted upwards, the width of the image was increased indefinitely, not taking into account the value of resizeToWidth.


Changes: The crop() method was added. The preserveSourceFileTime property was added, which instructs the scripts to preserve the date and time of the source files and pass them on to the target files. The flip methods now use the imagecopyresampled function instead of using imagecopy. The script no longer crashes when a valid path which is not a file is specified as a source file. Error handling for the create_image_from_source_file() private method was fixed, so the script can no longer be easily crashed by specifying bogus source files.


Changes: If invalid sizes were specified for resizing (i.e. string or negative numbers) the script would crash. Resizing of transparent PNG24 files was not working. Working with PNG files would always make the value of the "error" property equal to 5, even if everything went well. When resizing, interpolation was not used and the resulting images were rough. Resizing was not working correctly in some cases. All of these bugs have been fixed. The imagecopyresampled() function is now used instead of imagecopyresized().


No changes have been submitted for this release.