Jump to content

watermark trouble..


darkfreaks

Recommended Posts

what am i doing wrong? my watermark function won't work but i am calling the function right i think.

 

if (move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {           watermark($file_path,$watermark,'png');          mysql_query("INSERT INTO gallery VALUES ('', '$username', '$time', '$caption' , '$file_path' )");          //echo $file_size.' is how big your file is. It was transferred.';          header('Location: gallery.php');      }

 

Link to comment
Share on other sites

ok here is my full code someone can look through it and tell me why it isn't watermarking correctly i am sure it is a path issue with the watermark but not sure  :-\

 

since i can only upload one file i will post the water mark function as well.

 

 

function watermarkImage($location){//load watermark$watermark=imagecreatefrompng("watermark.png");$watermark_height=imagesy($watermark);$watermark_width=imagesx($watermark);//watermark width and height$image=imagecreatetruecolor($watermark_width,$watermark_height);$image=imagecreatefrompng($location);//image size$size=getimagesize($location);$x_pos=$size[0] - $watermark_width - 10; // 10px away from left$y_pos=$size[1] - $watermark_height - 10;//10px way from bottom//overlay watermark on imageimagecopymerge($image, $watermark, $x_pos, $y_pos, 0, 0, $watermark_width, $watermark_height, 100);//save watermarked imageimagepng($image, $location);//cleanup image/watermarkimagedestroy($image);imagedestroy($watermark);}

 

 

[attachment deleted by admin]

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.