Interactively Crop Image via PHP (GD/GD2 Library):
imagecopyresampled() function of php
imagecopyresampled (
);
FOUR RECTANGLES
$src_image $dst_image
+------------+---------------------------------+ +------------+--------------------+
| | | | | |
| | | | $dst_y |
| | | | | |
| $src_y | +-- $dst_x --+----$dst_width----+ |
| | | | | | |
| | | | | Resampled | |
| | | | | | |
+-- $src_x --+------ $src_width ------+ | | $dst_height | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | +------------------+ |
| | Sample | | | |
| | | | | |
| | | | | |
| $src_height | | | |
| | | | +---------------------------------+
| | | |
| | | |
| +------------------------+ |
| |
| |
+----------------------------------------------+
// general
imagecopyresampled ( $dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_width, $dst_height, $src_width, $src_height );