I have an image with dimensions 1440 X 500
.
I need to crop this image on the left at 200px
and right at 200px
. That is the new image must have dimensions of 1040 X 500
.
I am trying this
$original_w = 1440;
$original_h = 500;
$new_w = 1040;
$new_h = 500;
$new_img = imagecreatetruecolor( $new_w, $new_h);
imagecopyresampled($new_img, $original_img, 200, 0, 200, 0, $new_w, $new_h, $original_w, $original_h);
I have not obtained a desirable result, please help, what I am doing wrong?