hello
I try to copy, resize the photo and add my logo as a watermark on it.
I success for copy and resize but on add logo I failed.
this is my code:
$original_name=$_FILES['original_file']['name'];
$preview_folder="/home/site/public_html/abs/preview/";
$preview_folder=$preview_folder.basename($original_name);
// The file
$filename = "$preview_folder";
// Set a maximum height and width
$width = 400;
$height = 400;
// Content type
header('Content-type: image/jpeg');
// Get new dimensions
list($width_orig, $height_orig) = getimagesize($filename);
$ratio_orig = $width_orig/$height_orig;
if ($width/$height > $ratio_orig) {
$width = $height*$ratio_orig;
} else {
$height = $width/$ratio_orig;
}
// Resample
$image_p = imagecreatetruecolor($width, $height);
$image = imagecreatefromjpeg($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
// Output
imagejpeg($image_p, "$preview_folder");
//water mark
$image2=imagecreatefromgif("/home/absim/public_html/abs/images/logo.gif");
imagecopymerge($image, $image2, 0,0,0, 0, $width, $height, 100);
didnt give me any error but water mark is not exist
hope can you help