forumnz Posted April 5, 2007 Share Posted April 5, 2007 To have a water mark imprinted in an image when it is uploaded? A unique one? Link to comment https://forums.phpfreaks.com/topic/45684-is-it-possible/ Share on other sites More sharing options...
MadTechie Posted April 5, 2007 Share Posted April 5, 2007 Yes read up on GD library IE you need watermark.png (notice use of the PNG format; GD 2.0+ has removed compatibility with GIF images) test.php?src=test.jpg <?php header('content-type: image/jpeg'); $watermark = imagecreatefrompng('watermark.png'); $watermark_width = imagesx($watermark); $watermark_height = imagesy($watermark); $image = imagecreatetruecolor($watermark_width, $watermark_height); $image = imagecreatefromjpeg($_GET['src']); $size = getimagesize($_GET['src']); $dest_x = $size[0] - $watermark_width - 5; $dest_y = $size[1] - $watermark_height - 5; imagecopymerge($image, $watermark, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height, 100); imagejpeg($image); imagedestroy($image); imagedestroy($watermark); ?> Link to comment https://forums.phpfreaks.com/topic/45684-is-it-possible/#findComment-221906 Share on other sites More sharing options...
forumnz Posted April 5, 2007 Author Share Posted April 5, 2007 What bout if a user uploads multiple images and wants a unique number on it? Link to comment https://forums.phpfreaks.com/topic/45684-is-it-possible/#findComment-221907 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.