• 12-12-2009, 11:57:48
    #10
    böyle bi hata aldım şimdi.

    Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: gd-jpeg: JPEG library reports unrecoverable error: in /home/xx/public_html/deneme/yaz.php on line 19
    
    Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: 'resim/b.jpg' is not a valid JPEG file in /home/xx/public_html/deneme/yaz.php on line 19
    
    Warning: imagesx(): supplied argument is not a valid Image resource in /home/xx/public_html/deneme/yaz.php on line 20
    
    Warning: imagesy(): supplied argument is not a valid Image resource in /home/xx/public_html/deneme/yaz.php on line 21
    
    Warning: imagecopymerge(): supplied argument is not a valid Image resource in /xx/snot/public_html/deneme/yaz.php on line 29
    
    Warning: imagedestroy(): supplied argument is not a valid Image resource in /xx/snot/public_html/deneme/yaz.php on line 35
  • 12-12-2009, 12:02:22
    #11
    Eposta Aktivasyonu Gerekmekte
    Bu class'da işini görecektir.

    http://www.ysfkc.com/php/php-ile-res...lusturmak.html
  • 12-12-2009, 12:25:45
    #12
    Üyeliği durduruldu
    webkarizma adlı üyeden alıntı: mesajı görüntüle
    böyle bi hata aldım şimdi.

    Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: gd-jpeg: JPEG library reports unrecoverable error: in /home/xx/public_html/deneme/yaz.php on line 19
    
    Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: 'resim/b.jpg' is not a valid JPEG file in /home/xx/public_html/deneme/yaz.php on line 19
    
    Warning: imagesx(): supplied argument is not a valid Image resource in /home/xx/public_html/deneme/yaz.php on line 20
    
    Warning: imagesy(): supplied argument is not a valid Image resource in /home/xx/public_html/deneme/yaz.php on line 21
    
    Warning: imagecopymerge(): supplied argument is not a valid Image resource in /xx/snot/public_html/deneme/yaz.php on line 29
    
    Warning: imagedestroy(): supplied argument is not a valid Image resource in /xx/snot/public_html/deneme/yaz.php on line 35
    üste yazılacak resim olarak gif veya png resim kullanmışsın sanırım, ondan bu hatayı verir. jpg ile hata vermez.
  • 12-12-2009, 12:39:59
    #13
    devturkeli adlı üyeden alıntı: mesajı görüntüle
    üste yazılacak resim olarak gif veya png resim kullanmışsın sanırım, ondan bu hatayı verir. jpg ile hata vermez.
    hayır jpg formatında.
  • 12-12-2009, 14:17:11
    #14
    Üyeliği durduruldu
    biraz toleranslı şekilde hazırladım, yanlış işlemler ve yanlış dosyalarda problem çıkmaması için. 4-5 kişi kod için pm atınca oturup yazdım iyi kullanmalar.
    <?php  
    //------------------------------------------------------------
    $klasor       = 'test';   // Üstüne damga basılacak resimlerin klasörü
    $damga        = 'c.png';    // Damga resmi
    $seffaflik    = 50;   // Şefaflık ayarı 0-100
    //------------------------------------------------------------
    
    $resimler = scandir($klasor);
    foreach ($resimler as $resim) 
    {
        $resim = $klasor . '/' . $resim;
        $resim_uzanti = end(explode(".", $resim));
        $damga_uzanti = end(explode(".", $damga));
        
        if ($resim_uzanti == 'jpg' || $resim_uzanti == 'jpeg' || $resim_uzanti == 'gif' || $resim_uzanti == 'png') 
        {
            ###########################################
            if ($damga_uzanti == 'jpg' || $damga_uzanti == 'jpeg') $damga_imaj_fonksiyon = 'imagecreatefromjpeg';
            else if ($damga_uzanti == 'png') $damga_imaj_fonksiyon = 'imagecreatefrompng';
            else if ($damga_uzanti == 'gif') $damga_imaj_fonksiyon = 'imagecreatefromgif';
    
            $damgaresim = @$damga_imaj_fonksiyon($damga);
            $damga_width = @imagesx($damgaresim);  
            $damga_height = @imagesy($damgaresim);  
    
            if ($resim_uzanti == 'jpg' || $resim_uzanti == 'jpeg' || $resim_uzanti == 'jpe') {
                $resim_imaj_fonksiyon = 'imagecreatefromjpeg';
                $resim_imaj_fonksiyon2 = 'imagejpeg';
            } else if ($resim_uzanti == 'png') {
                $resim_imaj_fonksiyon = 'imagecreatefrompng';
                $resim_imaj_fonksiyon2 = 'imagepng';
            } else if ($resim_uzanti == 'gif') {
                $resim_imaj_fonksiyon = 'imagecreatefromgif';
                $resim_imaj_fonksiyon2 = 'imagegif';
            }
            $imaj = @imagecreatetruecolor($damga_width, $damga_height);  
            $imaj = @$resim_imaj_fonksiyon($resim);  
            $size = @getimagesize($resim);  
            @imagecopymerge($imaj, $damgaresim, ($size[0] - $damga_width - 5), ($size[1] - $damga_height - 5), 
                           0, 0, $damga_width, $damga_height, $seffaflik);  
            @$resim_imaj_fonksiyon2($imaj, $resim, 85);  
            @imagedestroy($imaj);  
            @imagedestroy($damgaresim);  
            ###########################################
        }
    }
    ?>
  • 12-12-2009, 14:34:30
    #15
    teşekkürler hocam şimdi oldu.