phillips321 Posted October 12, 2007 Share Posted October 12, 2007 Hi guys, My site takes in a photo and currently adds a watermark to the bottom right as shown by the code at the bottom of this message. Instead i would like to take in an image like this: and turn it into a pic like this how could this be done? i guess the logical way to do it would be to create another image +40px on both height and width and then apply the original image to the centre of the new image. I would then need to get the border going around the outside in some sort of fasion. Cheers in advance imagealphablending($img, true); //turn on transparency on image $overlay = imagecreatefrompng($overlay); //create overlay image using user set file $owidth = imagesx($overlay); //get width of overlay image $oheight = imagesy($overlay); //get height of overlay image imagecopy($img, $overlay, $iwidth - $owidth, $iheight - $oheight, 0, 0, $owidth, $oheight); //apply overlay to image imagedestroy($overlay); //Get rid of temporary overlay file... Quote Link to comment https://forums.phpfreaks.com/topic/72891-watermark-border-is-this-possible-pics-inside/ Share on other sites More sharing options...
sKunKbad Posted October 12, 2007 Share Posted October 12, 2007 It kind of defeats the purpose of a watermark to have it on the edge. If somebody steals your image and crops it, they basically have the regular image. Ideally the watermark goes right through the focal point of the image. Quote Link to comment https://forums.phpfreaks.com/topic/72891-watermark-border-is-this-possible-pics-inside/#findComment-367645 Share on other sites More sharing options...
phillips321 Posted October 12, 2007 Author Share Posted October 12, 2007 im not so much worried about people stealing the image as the whole i dea will be that the image will be hosted on my website for them. Quote Link to comment https://forums.phpfreaks.com/topic/72891-watermark-border-is-this-possible-pics-inside/#findComment-367795 Share on other sites More sharing options...
phillips321 Posted October 12, 2007 Author Share Posted October 12, 2007 can anyone get me pointed into the right direction? Quote Link to comment https://forums.phpfreaks.com/topic/72891-watermark-border-is-this-possible-pics-inside/#findComment-367941 Share on other sites More sharing options...
Barand Posted October 12, 2007 Share Posted October 12, 2007 http://www.php.net/imagettftext which lets you specify font, fontsize, position, textangle Quote Link to comment https://forums.phpfreaks.com/topic/72891-watermark-border-is-this-possible-pics-inside/#findComment-368021 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.