If i am trying to create new image from existing .jpeg image will gives black(blank) image.
My Code:
$new_path = 'post/'.time().'-myimage.jpeg';
$src="post/myimage.jpeg";
$jpeg_quality = 90;
$img_r = imagecreatefromjpeg($src);
$dst_r = ImageCreateTrueColor($my_post['w'], $my_post['h']);
imagecopyresampled($dst_r,$img_r,0,0,$my_post['x'],$my_post['y'],$my_post['w'],$my_post['h'],$my_post['w'],$my_post['h']);
header('Content-Type: image/jpeg');
imagejpeg($dst_r, $new_path, $jpeg_quality);