Answer the question
In order to leave comments, you need to log in
How do I combine an image and save it to the site directory?
Good afternoon, I need to implement combining images and saving to the site directory, but something doesn’t work for me.
src - source image, blue rectangle
srcUpload - image to be overlaid, black cross
$posX = $_POST['podp_x'];
$posY = $_POST['podp_y'];
$dest = imagecreatefromjpeg('../'.$_POST['src']);
$src = imagecreatefrompng('../'.$_POST['srcUpload']);
echo $_POST['src'];
echo $_POST['srcUpload'];
imagealphablending($dest, false);
imagesavealpha($dest, true);
imagecopymerge($src, $dest, 0, 0, $posX, $posY, 445, 492, 100);
$name = 'test.png';
imagefilter($dest, IMG_FILTER_GRAYSCALE);
imagepng( $dest, "../upload/".$name);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question