Ciao a tutti, ho la necessità di sovrapporre un png (con trasparenza) ad un files jpeg.
MI spiego meglio, ho una foto jpeg a cui devo sovrapporre una cornice (png con trasparenza).
ci stò perdendo la testa ma non riesco, questo è il mio codice, ma la foto, mi viene mostrata sopra la cornice, non sotto
Codice PHP:
<?php
$ImgCornice = "cornice.png";
$ImgFoto = "foto.jpg";
$resize = 300;
$altez = 450;
$cosa = getimagesize($ImgCornice);
$width = ($resize < $cosa[0]) ? $resize : $cosa[0];
$alte = (!$altez) ? ceil(($cosa[1] * $width)/$cosa[0])+1 : $altez;
$min = imagecreatetruecolor($width, $alte);
header('Content-Type: image/png');
$cornice = imagecreatefrompng($ImgCornice);
imagealphablending($min, false);
imagecopyresized($min, $cornice, 0, 0, 0, 0, $width, $alte, imageSx($cornice), imageSy($cornice));
$foto = imagecreatefromjpeg($ImgFoto);
imagecopymerge($min, $foto, 14, 16, 0, 0, 272, 215, 60);
imagesavealpha($min, true);
imagepng($min,'',8,PNG_ALL_FILTERS);
imagedestroy($min);
?>