Jump to content

Help with Watermark


theCro

Recommended Posts

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.