imagecopy creates a black image

236 views Asked by At

I am creating an image using the following code

$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);

but when the image is saved then this is a black image only.

I want to save an image but it is only the black image.

0

There are 0 answers