PHP image watermarker with file system cache
Image Watermarker with file system cache
Copy this code and paste it in your HTML
<?php
//ini_set('max_execution_time', 300);
header('content-type: image/jpeg'); header('Cache-control: max-age='.(60*60*24*365)); $cache_file = "./img/". hash('md5', $_GET['src']).".jpg";
} else { //CACHE MISS
$watermark_width = imagesx($watermark); $watermark_height = imagesy($watermark); $dest_x = $size[0] - $watermark_width - 5;
$dest_y = $size[1] - $watermark_height - 5;
imagecopy($image, $watermark, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height); }
?>
Report this snippet
Comments
Subscribe to comments