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
https://forums.phpfreaks.com/topic/215219-watermark-trouble/
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
https://forums.phpfreaks.com/topic/215219-watermark-trouble/#findComment-1119344
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.