Hi und Hallo,
ich überabeite grad meine Seite. Kann mir einer weiterhelfen wie ich in der funktion das Wasserzeichen mit einem bild hinbekomme und nicht aus einem Text ??
ich überabeite grad meine Seite. Kann mir einer weiterhelfen wie ich in der funktion das Wasserzeichen mit einem bild hinbekomme und nicht aus einem Text ??
Code:
<?php /* * JUpload php example * saves all uploaded files to the temp/ directory * see http://jupload.biz/ * info@jupload.biz * * Author: $Author$ * Date: $Date$ * Version: $Revision$ * Id: $Id$ */ /* * Iterate over all received files. * PHP > 4.2 / 4.3 ? will save the file information into the * array $_FILES[]. Before these versions, the data was saved into * $HTTP_POST_FILES[] */ $galerieID = $_REQUEST['galerieID']; if(!is_dir('../../upload/galerie/'.$galerieID)){ mkdir('../../upload/galerie/'.$galerieID.'/',0777); mkdir('../../upload/galerie/'.$galerieID.'/thumb',0777); mkdir('../../upload/galerie/'.$galerieID.'/sized/',0777); mkdir('../../upload/galerie/'.$galerieID.'/original/',0777); } include('../../class/mysql.class.php'); include('../../class/core.class.php'); $core = new CoreClass; $db = new MySqlClass; foreach($_FILES as $tagname=>$objekt) { // get the temporary name (e.g. /tmp/php34634.tmp) $tempName = $objekt['tmp_name']; // get the real filename $realName = str_replace(' ','',$objekt['name']); // where to save the file? $target = '../../upload/galerie/'.$galerieID.'/original/' . $realName; // print something to the user echo "<br>Processing file $realName...\n"; flush(); // move the file to the target directory move_uploaded_file($tempName,$target); # chmod($target,0777); /* This is a sample from Wilson * which will generate thumbnails from * the uploaded files. Use it, if you like. */ $src_img = imagecreatefromjpeg($target); $origw=imagesx($src_img); $origh=imagesy($src_img); $new_w = '580'; $ratio=$origh*$new_w; $new_h=$ratio/$origw; $new_h_sized = $new_h; $dst_img = imagecreatetruecolor($new_w,$new_h); imagecopyresampled($dst_img,$src_img,0,0,0,0,$new_w,$new_h,imagesx($src_img),imagesy($src_img)); $sized_target = '../../upload/galerie/'.$galerieID."/sized/" . $realName; #$watermark = imagecreatefromgif('../files/watermark.gif'); #imagealphablending($watermark, 1); $left = $new_w-200; $top = $new_h-10; //( zielbild, quellbild, ziel_start_x, ziel_start_y, quelle_start_x, quelle_start_y, quelle_breite, quelle_höhe, alpha ) # imagecopymerge($dst_img,$watermark,$left,$top,0,0,356,89,50); imagejpeg($dst_img, $sized_target,80); $src_tm = imagecreatefromjpeg($sized_target); #$img = imagecreatefromgif('../files/watermark.gif'); #$bg = imagecolorallocate($dst_img,0,0,0); $green = imagecolorallocate($dst_img,255,144,0); //imagestring($dst_img,8,$left,$top,"www.Adresse.de",$green); $font = "../files/arialbd"; imagettftext($dst_img, 15, 0, $left, $top, $green, $font, "www.Adresse.de"); imagejpeg($dst_img, $sized_target,80); # chmod($thum_target,0777); #$src_tm = imagecreatefromjpeg($thumb_target); $origw=imagesx($src_tm); $origh=imagesy($src_tm); $new_w = '170'; $ratio=$origh*$new_w; $new_h=$ratio/$origw; flush(); $dst_img = imagecreatetruecolor($new_w,$new_h); //$dst_img , $bild_quelle, x_ziel, y_ziel, x_quelle, y_quelle, breite_ziel, hoehe_ziel, breite_quelle, hoehe_quelle) imagecopyresampled($dst_img,$src_tm,0,0,0,0,$new_w,$new_h,$origw,$origh); $thumb_target = '../../upload/galerie/'.$galerieID."/thumb/" . $realName; imagejpeg($dst_img, $thumb_target,80); ///// if($new_h > 114){ echo "\n".$new_h."\n"; $src_tm = imagecreatefromjpeg($thumb_target); $dst_img = imagecreatetruecolor(170,114); imagecopyresampled($dst_img,$src_tm,0,0,0,20,170,114,170,114); $thumb_target = '../../upload/galerie/'.$galerieID."/thumb/" . $realName; imagejpeg($dst_img, $thumb_target,80); } $SQL = "INSERT INTO ".$core->_getPrefix()."pictures (`galerieID`,`original`,`sized`,`thumb`)"; $SQL.= " VALUES ('".$galerieID."','".$realName."','".$realName."','".$realName."')"; $db->MySqlQuery($SQL); unlink($target); // end of iteration echo "next file...\n"; flush(); } /* * This is optional. * send error response to jupload * format depends on API version of PHP */ /* switch(php_sapi_name()) { case 'cgi': case 'cgi-fcgi': $sz_htstatus = 'Status: '; break; default: $sz_htstatus = 'HTTP/1.0: '; break; } */ /* * Let's generate an error message for JUpload */ // everything is okay - default message //$sz_message='200 JUpload works great'; // if we got no files, show error message to user //if (count($_FILES) == 0) // $sz_message='406 No files uploaded'; // now, send the header to JUpload applet //header($sz_htstatus.$sz_message); // print debug code //echo "<br><pre>_FILES:\n"; //print_r($_FILES); //echo "</pre>\n"; flush(); ?>