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'); } Link to comment https://forums.phpfreaks.com/topic/215219-watermark-trouble/ 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] Link to comment https://forums.phpfreaks.com/topic/215219-watermark-trouble/#findComment-1119344 Share on other sites More sharing options...
BlueSkyIS Posted October 5, 2010 Share Posted October 5, 2010 where are you calling watermarkImage()? Link to comment https://forums.phpfreaks.com/topic/215219-watermark-trouble/#findComment-1119364 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.