darkfreaks Posted October 5, 2010 Share Posted October 5, 2010 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'); } Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted October 5, 2010 Author Share Posted October 5, 2010 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] Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted October 5, 2010 Share Posted October 5, 2010 where are you calling watermarkImage()? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.