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! Link to comment https://forums.phpfreaks.com/topic/125704-help-with-watermark/ 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'> Link to comment https://forums.phpfreaks.com/topic/125704-help-with-watermark/#findComment-649976 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! Link to comment https://forums.phpfreaks.com/topic/125704-help-with-watermark/#findComment-649991 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! Link to comment https://forums.phpfreaks.com/topic/125704-help-with-watermark/#findComment-649992 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... Link to comment https://forums.phpfreaks.com/topic/125704-help-with-watermark/#findComment-649997 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! Link to comment https://forums.phpfreaks.com/topic/125704-help-with-watermark/#findComment-650003 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. Link to comment https://forums.phpfreaks.com/topic/125704-help-with-watermark/#findComment-650019 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 Link to comment https://forums.phpfreaks.com/topic/125704-help-with-watermark/#findComment-650023 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 Link to comment https://forums.phpfreaks.com/topic/125704-help-with-watermark/#findComment-650032 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?? Link to comment https://forums.phpfreaks.com/topic/125704-help-with-watermark/#findComment-650039 Share on other sites More sharing options...
theCro Posted September 26, 2008 Author Share Posted September 26, 2008 anyone? Link to comment https://forums.phpfreaks.com/topic/125704-help-with-watermark/#findComment-651448 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.