brooksh Posted August 16, 2008 Share Posted August 16, 2008 Here is my script. Can anyone tell me what I'm doing wrong? $dw = 640; $prop = ($oldimagesize[0]/$dw); $dh = ($oldimagesize[1]/$prop); $sw = $oldimagesize[0]; $sh = $oldimagesize[1]; $largeimagename = 'large_' . $newimagename; $largeimagefull = $uploadDir . $largeimagename; $largeimage = imagecreatetruecolor($dw, $dh); imagecopyresampled($largeimage, $oldimage, 0, 0, 0, 0, $dw, $dh, $sw, $sh); $watermark = imagecreatefrompng('/home/photos/public_html/images/watermark.png'); $watermark_width = imagesx($watermark); $watermark_height = imagesy($watermark); $largeimage = imagecreatefromjpeg($largeimage); $size = getimagesize($largeimage); $dest_x = $size[0] - $watermark_width - 5; $dest_y = $size[1] - $watermark_height - 5; imagecopymerge($largeimage, $watermark, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height, 100); imagedestroy($watermark); call_user_func("image" . $imageTypes[$oldimagesize[2]], $largeimage, $largeimagefull); Link to comment https://forums.phpfreaks.com/topic/119915-trying-to-watermark-an-image-but-it-isnt-working/ Share on other sites More sharing options...
gerkintrigg Posted August 16, 2008 Share Posted August 16, 2008 ooh blimey... good luck. watermarking is a nightmare. I managed to do it on http://www.nextdaygraphics.com have a look and let me know if that's the kind of thing that you want and I'll see if i can dig out the code. Link to comment https://forums.phpfreaks.com/topic/119915-trying-to-watermark-an-image-but-it-isnt-working/#findComment-617993 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.