Firebird Raven Posted May 2, 2010 Share Posted May 2, 2010 I'm working at a script to place a watermark on uploaded pictures. The uploading is working very well. But I can't place a watermark on it. The script finds the watermark without a problem and if I call it somewhere in the script, it can be shown. But when I do the same with the image, it tells me that it's an array? Is this normal? Does someone find my errors in the script perhaps? Here is the watermark and uploading part of my script: $dir = "./Foto/$maker/$jaar"; $path_watermerk = "./Copyrights/$water"; if (file_exists($dir)) { echo "Jaar <b>$jaar</b> bestond reeds en diende niet aangemaakt te worden!<BR/>"; mkdir("$dir/$map", 0755); echo "Map: <b>$map</b> is succesvol aangemaakt!<BR/><BR/>"; $dir2 = "./Foto/$maker/$jaar/$map"; for ($i = 1, $j = 0; $i <= $aantal; $i++, $j++) { $k = 0; $k= "$dir2/".$_FILES ['ufile']['name'][$j]; $chmod = $_FILES ['ufile']['name'][$j]; copy($_FILES ['ufile']['tmp_name'][$j], $k); $watermerk = imagecreatefrompng($path_watermerk); $watermerk_width = imagesx($watermerk); $watermerk_height = imagesy($watermerk); imagecreatetruecolor($watermerk_width, $watermerk_height); $image = imagecreatefromjpeg($k); $size = getimagesize($k); $xas = $size[0] - $watermerk_width - 5; $yas = 5; imagecopymerge($image, $watermerk, $xas, $yas, 0, 0, $watermerk_width, $watermerk_height, 100); imagejpeg($image, $k); echo "Foto $i is succesvol geupload!<BR/>"; } } else { $dir = "./Foto/$maker"; mkdir("$dir/$jaar", 0755); echo "Jaar <b>$jaar</b> bestond nog niet en is succesvol aangemaakt<BR/>"; mkdir("./Foto/$maker/$jaar/$map", 0755); echo "Map: <b>$map</b> is succesvol aangemaakt!<BR/><BR/>"; $dir2 = "./Foto/$maker/$jaar/$map"; for ($i = 1, $j = 0; $i <= $aantal; $i++, $j++) { $k = 0; $k= "$dir2/".$_FILES ['ufile']['name'][$j]; $chmod = $_FILES ['ufile']['name'][$j]; copy($_FILES ['ufile']['tmp_name'][$j], $k); $watermerk = imagecreatefrompng($path_watermerk); $watermerk_width = imagesx($watermerk); $watermerk_height = imagesy($watermerk); imagecreatetruecolor($watermerk_width, $watermerk_height); $image = imagecreatefromjpeg($k); $size = getimagesize($k); $xas = $size[0] - $watermerk_width - 5; $yas = 5; imagecopymerge($image, $watermerk, $xas, $yas, 0, 0, $watermerk_width, $watermerk_height, 100); imagejpeg($image, $k); echo "Foto $i is succesvol geupload!<BR/>"; } } Thanks if you can help me out with this one. 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.