我正在使用以下代码
创建图像$src = imagecreatefromjpeg('/var/www/demo/wp-content/plugins/eNewsPaper/menu-pages/newspaper/02_3.jpg');
$dest = imagecreatetruecolor(($_POST['width']*2), $_POST['height']*2);
$new_path = '/var/www/demo/wp-content/plugins/eNewsPaper/menu-pages/epaper_single/'.$_POST['fid'].'/'.$_POST['imgno'].'.jpg';
// Copy
//echo $dest;
imagecopy($src, $src, 0, 0, $_POST['x1']*2, $_POST['y1']*2, 1400, 2225);
// Output and free from memory
imagejpeg($dest, $new_path);
但保存图像后,这只是一张黑色图像。
我想要保存图像,但它只是黑色图像。