• 12-09-2008, 21:07:42
    #1
    Warning: imagettftext() [function.imagettftext]: Could not find/open font in /home/dddd/public_html/upload.php on line 39

    arkadaşlar bu hatayı nasıl düzelte bilirim
    Kod
    <?php
    $array = array("ı" ,"ü" ,"ç" ,"ö" ,"İ" ,"Ü" ,"Ğ" ,"ğ" ,"Ö" ,"Ş" ," ");
    $hedefim = "img/".$dosya;
    $baslik=$_POST["baslik"]; // Formdan Gelen Basligi Aldik
    $kaynak = $_FILES["resim"]["tmp_name"];
    $dosya = str_replace(" ", "_", $_FILES["resim"][name]);
    $dosya = str_replace($array, '-',$dosya);
    if (file_exists($hedefim)) {
        $hmz = substr(md5(uniqid(rand())),0,8);
        $hedefim = "img/$hmz-".$dosya;
        $dosya = "$hmz-".$dosya;
    }
    $hedefim = strtolower($hedefim);
    move_uploaded_file($kaynak,$hedefim);
    $xxx = getimagesize($hedefim);
    $buyuk_en=$xxx[0] ;
    $buyuk_boy= $xxx[1] -5 ;
    $resim = substr($_FILES["resim"][type], strpos($_FILES["resim"][type],'/')+1);
       switch($resim) {
           case 'jpeg':
           case 'pjpeg':
           case 'tiff';
               $resim = imagecreatefromjpeg($hedefim);
               break;
           case 'png':
           case 'x-png':
               $resim = imagecreatefrompng($hedefim);
                 break;
           case 'gif':
               $resim = imagecreatefromgif($hedefim);
               break;
           default:
               return FALSE;
               break;
       }
    $beyaz = imagecolorallocate($resim, 255,255,255);
    $siyah = imagecolorallocate($resim, 0, 0, 0);
    imagettftext($resim, 30, 0, 5, $buyuk_boy, $beyaz, "2.ttf", "$baslik"); // Burada Resimin ustune Yazı yazıyoruz ;)
    imagejpeg($resim,$hedefim,100);
    echo "$hedefim";
    ?>
  • 12-09-2008, 21:25:36
    #2
    Kurumsal PLUS
    font dosyasını, yani bu kodda belirtildiği üzere 2.ttf dosyasını sunucuda bulamamış. istediğin fontu 2.ttf adında ftp'ye atarsan çalışır
  • 12-09-2008, 21:46:33
    #4
    sağolun arkadaşlar bu dosyayı tam olarak hangi dizine atmam gerekiyor.
    dosyaların bulunduğu dizine /public_html attım ama olmadı
  • 12-09-2008, 21:55:38
    #5
    imagettftext($resim, 30, 0, 5, $buyuk_boy, $beyaz, "/home/dddd/public_html/2.ttf", "$baslik"); // Burada Resimin ustune Yazı yazıyoruz

    tam yol eklersen sorun kalmaz.
  • 12-09-2008, 22:01:55
    #6
    sağolun arkadaşlar direk yolu yazınca hata vermedi ama yazıyıda yazmadı sorun ne olabilir
  • 12-09-2008, 22:24:27
    #7
    $baslik= degiskeni bos olabilir
  • 12-09-2008, 22:33:04
    #8
    arkadaşlar sağolun aslında yazıyormu ama resmin arka planı beyaz yazıda beyaz nasıl görecem dimi sağolun tekrardan.

    Bir sorum daha var arkadaşlar
    resim üzerine resim yani logoyu nasıl ekleriz?