Hi
ive written the function:
problem is its not watermarking anything nor showing any errors.
any help?>
ive written the function:
PHP:
//Watermark the image...
function add_watermark($image) {
$overlay = "site_images/imgcafe_watermark.gif";
$w_offset = 0;
$h_offset = 0;
$extension = strtolower(substr($image, strrpos($image, ".") +1));
switch ($extension)
{
case 'jpg':
$background = imagecreatefromjpeg($image);
break;
case 'gif':
$background = imagecreatefromgif($image);
break;
case 'png':
$background = imagecreatefrompng($image);
break;
default:
die("Image type not supported");
}
$base_width = imagesx($background);
$base_height = imagesy($background);
imagealphablending($background, true);
$overlay = imagecreatefromgif($overlay);
imagesettile($background, $overlay);
// Make the image repeat
imagefilledrectangle($background, 0, 0, $base_width, $base_height, IMG_COLOR_TILED);
header('Content-type: image/png');
imagepng($background);
}
problem is its not watermarking anything nor showing any errors.
any help?>