theCro Posted September 25, 2008 Share Posted September 25, 2008 Hello guys, thanks for stopping by and trying to fix my problems i have this code: <?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); ?> but, i do not know how to execute this code in web browser address, for example http://www.mysite.com/watermark.php?image=image.jpg please help, thanks alot in advance! Quote Link to comment Share on other sites More sharing options...
rarebit Posted September 25, 2008 Share Posted September 25, 2008 basically you treat this file like an image <img src='http://www.mysite.com/watermark.php?image=image.jpg'> Quote Link to comment Share on other sites More sharing options...
theCro Posted September 25, 2008 Author Share Posted September 25, 2008 basically you treat this file like an image <img src='http://www.mysite.com/watermark.php?image=image.jpg'> however that didnt work, i just tried that :/ do you have any other samples i can make my code work as image with watermark.. ? thanks! Quote Link to comment Share on other sites More sharing options...
theCro Posted September 25, 2008 Author Share Posted September 25, 2008 actually it works : http://www.zadarsport.com/watermark.php?src=acost.jpg but the png is in wrong colors! Quote Link to comment Share on other sites More sharing options...
rarebit Posted September 25, 2008 Share Posted September 25, 2008 The manual is full of examples, but well done... Quote Link to comment Share on other sites More sharing options...
theCro Posted September 25, 2008 Author Share Posted September 25, 2008 The manual is full of examples, but well done... i'm not into php codes that much, that's why i asked here.. if you can help me please.. or anyone who knows the answer ... i need to know why colors are wrong and why png is not looking like original, as i posted above in example... :/ thanks! Quote Link to comment Share on other sites More sharing options...
rarebit Posted September 25, 2008 Share Posted September 25, 2008 as for colours I can only speculate that its to do with the watermark image? I find that outputting as jpg creates too many artifacts for my liking so I tend to stick to png or losses formats. Quote Link to comment Share on other sites More sharing options...
theCro Posted September 25, 2008 Author Share Posted September 25, 2008 as for colours I can only speculate that its to do with the watermark image? I find that outputting as jpg creates too many artifacts for my liking so I tend to stick to png or losses formats. i saved watermark.png in photoshop in 8 16 bits... all possible versions and still messed image as you can see above in my example Quote Link to comment Share on other sites More sharing options...
rarebit Posted September 25, 2008 Share Posted September 25, 2008 not really, would need to the watermark before application Quote Link to comment Share on other sites More sharing options...
theCro Posted September 25, 2008 Author Share Posted September 25, 2008 not really, would need to the watermark before application so what do i do?? Quote Link to comment Share on other sites More sharing options...
theCro Posted September 26, 2008 Author Share Posted September 26, 2008 anyone? Quote Link to comment 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.