Using PHP Image Editor

Last time I got an assignment to create a simple CMS and I integrate a PHP Image Editor in it. This PHP Image Editor source is provided in http://www.hotscripts.com. I think we should give the developer a credits. I only distributed this file. This PHP Image Editor offer a very good feature with a good GUI. The feature are such as Image Cropping, Resizing, Filtering(Effect) and Rotating. All the basic function needed for Image Editing already included here.

And also I will give a short tutorial how to integrate this PHP Image Editor to your application.
Note that we must provide an image to the application. We can accomplished this by change the :

$srcEdit = ""; -> to the image filename or URL.
This variable is in the function PHPImageEditor() in classes/phpimageeditor.php.

Provide the image filename and you can use the application now. A simple way to accomplished this is using a constructor parameter. Note that an object for PHP Image Editor class is created in index.php :

global $objPHPImageEditor;
$objPHPImageEditor = new PHPImageEditor();

We can simply change this to :

global $objPHPImageEditor;
$objPHPImageEditor = new PHPImageEditor($filename);

Next, we need to change the PHPImageEditor function in classes/phpimageeditor.php :

function PHPImageEditor($filename)
{
.....
$srcEdit = $filename;
.....
}

Here is the source of PHP Image Editor if you want to download it :


Tags : PHP, Image Editor, PHP Image Processing

Best Regards,
Admin



0 comments: