include the Zebra_Image library
require 'path/to/Zebra_Image.php';
instantiate the class
$img = new Zebra_Image();
a source image
$img->source_path = 'path/to/source.ext';
path to where should the resulting image be saved
note that by simply setting a different extension to the file will
instruct the script to create an image of that particular type
$img->target_path = 'path/to/target.ext';
crop a rectangle of 100x100 pixels, starting from the top-left corner
$img->crop(0, 0, 100, 100);
public crop ( integer $start_x, integer $start_y, integer $end_x, integer $end_y ) : boolean | ||
$start_x | integer | x coordinate to start cropping from @param integer $start_y y coordinate to start cropping from @param integer $end_x x coordinate where to end the cropping @param integer $end_y y coordinate where to end the cropping @since 1.0.4 @return boolean Returns TRUE on success or FALSE on error. If FALSE is returned, check the {@link error} property to see the error code. |
$start_y | integer | |
$end_x | integer | |
$end_y | integer | |
return | boolean |