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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.