Re: [Linux-programlama] thumbnail fonksiyon problemi

---------

New Message Reply About this list Date view Thread view Subject view Author view Attachment view

From: serkan@cozum.com
Date: Mon 11 Jul 2005 - 23:36:18 EEST


thumbnail resmin yazılacagı dizinin hakları 777 olmalı ayrıca sahibi ve
grubu php ile aynı olmalıdır. Database ye yazdırmanı tavsiye etmem cunku
resme her istek geldiginde databasede yeniden okunacak yani tempolary e
atması soz konusu degil. Bu da sayfayı yavaslatacak. Bence resmi
olusturmayı dene..localinde sorun yoksa serverda haklarla ilgili sorun
vardır. Hatayı gonderirsen yardımcı olmaya calısırım...
> Selam,
>
>
>
> Bir tane php fonksiyonum var. Fonksiyon normal bir fotoyu thumbnail haline
> getiriyor. Localhostumda calistirdigimda problem yok. Ancak bir virtual
> hotsa yerlestirdigimde thumbnail formatini yazamiyor. Gerekli izni yok
> diye.
> Tahmin ediyorum scripti apachenin calistirildigi kullaniciyla calistirmam
> gerekiyor. Ancak virtual host oldugu icin dosyanin sahibini
> degistiremiyorum. Ayni sekilde formdan gonderilen fotolari da herhangi bir
> klasore kopyalatamiyorum. Bende formdan gelen fotolari database kayit
> ederek
> buyuk fotolar bir cozum buldum ancak thumbnail de olusan fotoyu database e
> kaydettiremedim cunku fonksiyon direk yeni fotoyu diske yazmaya calisiyor.
> Ben fonksiyonu buraya yazicam eger fonksiyondan olusan veriyi database e
> nasil aktaracagim konusunda bilgi verirseniz sevinirim. Tabi baksa bir
> yontem ya da bilgiye de acigim.
>
>
>
> Iyi calismalar
>
> Yunus Emre Kose
>
> Tesekkurler
>
>
>
> function createthumb($name,$filename,$new_w,$new_h)
>
> {
>
> $system=explode(".",$name);
>
> if
> (preg_match("/jpg|jpeg/",$system[1])){$src_img=imagecreatefromjpeg($name);}
>
> if
> (preg_match("/png/",$system[1])){$src_img=imagecreatefrompng($name);}
>
> $old_x=imageSX($src_img);
>
> $old_y=imageSY($src_img);
>
> if ($old_x > $old_y)
>
> {
>
> $thumb_w=$new_w;
>
> $thumb_h=$old_y*($new_h/$old_x);
>
> }
>
> if ($old_x < $old_y)
>
> {
>
> $thumb_w=$old_x*($new_w/$old_y);
>
> $thumb_h=$new_h;
>
> }
>
> if ($old_x == $old_y)
>
> {
>
> $thumb_w=$new_w;
>
> $thumb_h=$new_h;
>
> }
>
> $dst_img=ImageCreateTrueColor($thumb_w,$thumb_h);
>
>
> imagecopyresampled($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y
> );
>
> if (preg_match("/png/",$system[1]))
>
> {
>
> imagepng($dst_img,$filename);
>
> } else {
>
> imagejpeg($dst_img,$filename);
>
> }
>
> imagedestroy($dst_img);
>
> imagedestroy($src_img);
>
> }
>
>
>
> _______________________________________________
> Linux-programlama mailing list
> Linux-programlama@liste.linux.org.tr
> http://liste.linux.org.tr/mailman/listinfo/linux-programlama
>

_______________________________________________
Linux-programlama mailing list
Linux-programlama@liste.linux.org.tr
http://liste.linux.org.tr/mailman/listinfo/linux-programlama


New Message Reply About this list Date view Thread view Subject view Author view Attachment view

---------

Bu arsiv hypermail 2.1.2 tarafindan uretilmistir.