$image_p = imagecreatetruecolor($new_width, $new_height);
$image = imagecreatefromjpeg($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_heig
After you applied imagecopyresampled()
, the $dst_image
will be your image resource identifier.
Just applying the imagecopyresampled()
function does not automagically also save it to the file system.
So you will need to save it, using one of the functions imagejpeg()
, imagepng()
// Output
imagejpeg($dst_image, 'new-image.jpg', 100);