class.upload.php is a powerful and mature PHP class to manage uploaded files, and manipulate images in many ways. The script is available under a GPL license.
more info about the class
$image_width = '600'; $image_height = '200'; $source_x = (int)$_POST['source_x']; $source_y = (int)$_POST['source_y']; $src = imagecreatefromjpeg('current_image.jpg'); $dest = imagecreatetruecolor($image_width, $image_height); imagecopy($dest, $src, 0, 0, $source_x, $source_y, $image_width, $image_height);
With this class how do I crop current image according to new $source_x & $source_y?