PCnet Online
Geri Dön   PCnet Online > Web Tasarımı ve Geliştirme > Web Programlama > PHP
Bu Sayfayı Yenile Resim Upload Ederken Resim Üzerine Logo Basma Yardım????
Yanıtla
 
Başlık Araçları
  (#1) Eski
 
Mesaj: 1
Katılım Tarihi: 2008
Exclamation Resim Upload Ederken Resim Üzerine Logo Basma Yardım???? - 20.05.2008, 15:52


Bir Türlü Upload Ettiğim Resmin Üzerine Watermark Basıp Kaydedemedim. Yapmış Olduğum Bir Resim Upload Sistemi Var Ve Bu Upload Sisteminde Resmi Upload Ettikten Sonra Resim 3 Şekilde Kayıt Ediyor.

1. Orjinal Hiç Bozulmamış Hali.
2.Resize Edilmiş 640*%
3.Resize Edilmiş Thumb 15*%

Benim Yapmak İstediğim Upload Ettiğim Resmin Üstüne Watermark Basıp Bu İşlemleri Ondan Sonra Yapmak Ve Upload Ettiğim 3 Farklı Resminde Üzerinde Watermark Olması Baya Bi Watermark Scripti Denedim Ama Olmadı. Yapamadım Yazmış Olduğum Kodlar Aşağıdaki Gibi.

Bu form.php
Kod:
<fieldset><legend><strong>Image Uploader</strong></legend>
<form action="yukle.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="2000000" />
<p><label for="dosya">Select A File For Upload</label><input type="file" name="dosya" id="dosya" />
<input type="submit" value="Upload File" />
<br />
<br />Just JPG Files Allowed.
<br />Max. File Size 2MB.
</form>
</fieldset>
Buda yukle.php
Kod:
<?php

        $dosya_ismi=$_FILES['dosya']['name'];
        $gecici_yer=$_FILES['dosya']['tmp_name'];
        $MAX_FILE_SIZE=$_FILES['dosya']['size'];
        $dosya_tipi=$_FILES['dosya']['type'];
        $dosya_uzantisi=substr($dosya_ismi,-4);
        $hata_mesaji=$_FILES['dosya']['error'];

    if ($dosya_ismi==""«») 
    {
        echo '<fieldset><legend><strong>Your File Can Not Upload...</strong></legend>';
        echo "Please Check Your File Name.<br />";
        echo '<a href="form.php">Click Here For Upload A Picture</a>';
        echo '</fieldset>';
    }
    elseif ($_FILES['dosya']['error']>0)
    {
        echo '<fieldset><legend><strong>Your File Can Not Upload...</strong></legend>';
        echo $hata_mesaji.' Please Check Your PHP.INI Settings<br />';
        echo '<a href="form.php">Click Here For Upload A Picture</a>';
        echo '</fieldset>';
    }
    elseif($MAX_FILE_SIZE>2000000)
    {
        echo '<fieldset><legend><strong>Your File Can Not Upload...</strong></legend>';
        echo "Please Check Your File Size (Max. File Size = 2 MB.)<br />";
        echo '<a href="form.php">Click Here For Upload A Picture</a>';
        echo '</fieldset>';
    }
        elseif($dosya_tipi=="image/jpeg"«»)
    {
        $id='01';
        $taksim='/';
        $orjinal_dosya='orjinal';
        $normal_dosya='normal';
        $thumb_dosya='thumb';
        $ana_dizin='dosyalar';
        $orjinal_klasor=$ana_dizin.$taksim.$id.$taksim.$orjinal_dosya.$taksim;
        $normal_klasor=$ana_dizin.$taksim.$id.$taksim.$normal_dosya.$taksim;
        $thumb_klasor=$ana_dizin.$taksim.$id.$taksim.$thumb_dosya.$taksim;
        $doyaadi_date=date(HisdmY);
        $gercek_isim=$doyaadi_date.substr($dosya_ismi,-4);
        // Bu Kisim Resmimizden normal boyutta resim olusturmak icin..
        $src = imagecreatefromjpeg($gecici_yer);
        list($width,$height)=getimagesize($gecici_yer);
        $newwidth=640;
        $newheight=($height/$width)*640;
        $tmp=imagecreatetruecolor($newwidth,$newheight);
        imagecopyresampled($tmp,$src,0,0,0,0,$newwidth,$newheight,$width,$height);
        $filename = $normal_klasor. $gercek_isim;
        imagejpeg($tmp,$filename,100);
        // Burasi normal boyutlandirma isleminin bittigi yer.
        // Bu Kisim Resmimizden thumb. resim olusturmak icin..
        $src = imagecreatefromjpeg($gecici_yer);
        list($width,$height)=getimagesize($gecici_yer);
        $newwidth=150;
        $newheight=($height/$width)*150;
        $tmp=imagecreatetruecolor($newwidth,$newheight);
        imagecopyresampled($tmp,$src,0,0,0,0,$newwidth,$newheight,$width,$height);
        $filename = $thumb_klasor. $gercek_isim;
        imagejpeg($tmp,$filename,100);
        imagedestroy($src);
        imagedestroy($tmp);
        // Burasi thumb. yapma isleminin bittigi yer.
        move_uploaded_file($gecici_yer,$orjinal_klasor.$gercek_isim);
        echo '<fieldset><legend><strong>Your Image Uploaded Succesfully...</strong></legend>';
        echo '<fieldset><legend><strong>File Link: '.$orjinal_klasor. $gercek_isim.'</strong></legend>';
        echo '<img src="'.$orjinal_klasor.$gercek_isim.'"/><br /></fieldset>';
        echo '<fieldset><legend><strong>File Link: '.$normal_klasor. $gercek_isim.'</strong></legend>';
        echo '<img src="'.$normal_klasor.$gercek_isim.'"/><br /></fieldset>';
        echo '<fieldset><legend><strong>File Link: '.$thumb_klasor. $gercek_isim.'</strong></legend>';
        echo '<img src="'.$thumb_klasor.$gercek_isim.'"/><br /></fieldset>';
        echo '<a href="form.php">Click Here For Upload A New Picture</a>';
        echo '</fieldset>';
    }
    elseif($dosya_tipi=="image/pjpeg"«»)
    {
        $id='01';
        $taksim='/';
        $orjinal_dosya='orjinal';
        $normal_dosya='normal';
        $thumb_dosya='thumb';
        $ana_dizin='dosyalar';
        $orjinal_klasor=$ana_dizin.$taksim.$id.$taksim.$orjinal_dosya.$taksim;
        $normal_klasor=$ana_dizin.$taksim.$id.$taksim.$normal_dosya.$taksim;
        $thumb_klasor=$ana_dizin.$taksim.$id.$taksim.$thumb_dosya.$taksim;
        $doyaadi_date=date(HisdmY);
        $gercek_isim=$doyaadi_date.substr($dosya_ismi,-4);
        // Bu Kisim Resmimizden normal boyutta resim olusturmak icin..
        $src = imagecreatefromjpeg($gecici_yer);
        list($width,$height)=getimagesize($gecici_yer);
        $newwidth=640;
        $newheight=($height/$width)*640;
        $tmp=imagecreatetruecolor($newwidth,$newheight);
        imagecopyresampled($tmp,$src,0,0,0,0,$newwidth,$newheight,$width,$height);
        $filename = $normal_klasor. $gercek_isim;
        imagejpeg($tmp,$filename,100);
        // Burasi normal boyutlandirma isleminin bittigi yer.
        // Bu Kisim Resmimizden thumb. resim olusturmak icin..
        $src = imagecreatefromjpeg($gecici_yer);
        list($width,$height)=getimagesize($gecici_yer);
        $newwidth=150;
        $newheight=($height/$width)*150;
        $tmp=imagecreatetruecolor($newwidth,$newheight);
        imagecopyresampled($tmp,$src,0,0,0,0,$newwidth,$newheight,$width,$height);
        $filename = $thumb_klasor. $gercek_isim;
        imagejpeg($tmp,$filename,100);
        imagedestroy($src);
        imagedestroy($tmp);
        // Burasi thumb. yapma isleminin bittigi yer.
        move_uploaded_file($gecici_yer,$orjinal_klasor.$gercek_isim);
        echo '<fieldset><legend><strong>Your Image Uploaded Succesfully...</strong></legend>';
        echo '<fieldset><legend><strong>File Link: '.$orjinal_klasor. $gercek_isim.'</strong></legend>';
        echo '<img src="'.$orjinal_klasor.$gercek_isim.'"/><br /></fieldset>';
        echo '<fieldset><legend><strong>File Link: '.$normal_klasor. $gercek_isim.'</strong></legend>';
        echo '<img src="'.$normal_klasor.$gercek_isim.'"/><br /></fieldset>';
        echo '<fieldset><legend><strong>File Link: '.$thumb_klasor. $gercek_isim.'</strong></legend>';
        echo '<img src="'.$thumb_klasor.$gercek_isim.'"/><br /></fieldset>';
        echo '<a href="form.php">Click Here For Upload A New Picture</a>';
        echo '</fieldset>';
    }
    else
    {
        echo '<fieldset><legend><strong>Your File Can Not Upload...</strong></legend>';
        echo "<p>Please Check Your File Name.<br />";
        echo "Please Check Your File Type<br />";
        echo "Just JPEG Files Allowed<br />";
        echo "Please Check Your File Size (Max. File Size = 2 MB.)<br />";
        echo ' Please Check Your PHP.INI Settings Error = ('.$hata_mesaji.')<br />';
        echo '<a href="form.php">Click Here For Upload A Picture</a></p></p>';
        echo '</fieldset>';    
    }
?>
Upload Edilen Resimlerin Üzerine Watermark Basmam İçin Ne Yapmam Gerekiyor Acaba Yardımcı Olursanız Sevinirim.
Şimdiden Teşekkür Ederim.
Alıntıyla Yanıtla
Yanıtla

Başlık Araçları


Benzer Başlıklar
Başlık Başlığı Açan Forum Yanıt Son Mesaj
wordde resim üzerine yazı metin_4545 Yazılım 1 18.03.2008 19:33
Resim üzerine yazı (logo) ekleme. ss Web ve Grafik Tasarımı 3 15.02.2008 15:55
canon pixma mp160 resim basma dilemma86 Donanım 3 30.10.2007 00:21
resim üzerine gif yapıştırmak oguzyy Web ve Grafik Tasarımı 4 11.04.2006 14:43
CD Üzerine Resim Çizme contact Donanım 7 15.05.2004 22:16



vBulletin® Sürüm 3.8.2 ile güçlendirilmiştir
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
© Doğan Burda Dergi Yayıncılık ve Pazarlama A.Ş. Hürriyet Medya Towers 34212 Güneşli - İstanbul

En Son Mesajlar

48 gösterim, 4 yanıt

0 gösterim, 1 yanıt

4274 gösterim, 45 yanıt

433 gösterim, 48 yanıt

18 gösterim, 2 yanıt

46 gösterim, 7 yanıt

0 gösterim, 0 yanıt

22 gösterim, 2 yanıt

27 gösterim, 3 yanıt

9 gösterim, 1 yanıt

4 gösterim, 0 yanıt

117 gösterim, 12 yanıt

2282 gösterim, 10 yanıt

30 gösterim, 5 yanıt

28 gösterim, 2 yanıt