Re: [Linux-programlama] thumbnail fonksiyon problemi

---------

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

From: Noyan Selcuk HANCIOGLU (noyan@ai.com.tr)
Date: Tue 12 Jul 2005 - 00:05:05 EEST


apache scriptini calistirdiginda, nobody veya apache kullanici/grup'i
ile calistirdigi icin ve senin dizinin user/grup'u kendi kullanici adin
oldugu icin yazamamasi dogal.
thumnail icin bir dizin olusturup chmod'u 777 yaparsan problemi cozersin
anca

Yunus Emre Köse wrote:

>Zaten problemde biraz orda sistem virtual host oldugu icin benim bir shell
>accountum yok. Yani kullanici, dosya grubu, sahibi degistirme gibi bir
>sansim yok. Varsa bile ben bilmiyorum. Birde 777 olursa herkesin yazip cizme
>gibi bir hakki olmaz mi? Ben yine de hatayi size yazacagim.
>
>Warning: imagejpeg(): Unable to open 'deneme.jpg' for writing in
>/home/httpd/vhosts/-Virtual Host Domain-/httpdocs/thumbnail_generator.php on
>line 64
>
>Fonksiyonda x.jpg adli bir dosyayi thumbnail seklinde deneme.jpg adiyla
>kaydetmeye calisiyor.
>
>
>
>Yunus Emre Kose
>
>
>-----Original Message-----
>From: linux-programlama-bounces@liste.linux.org.tr
>[mailto:linux-programlama-bounces@liste.linux.org.tr] On Behalf Of
>serkan@cozum.com
>Sent: Monday, July 11, 2005 11:36 PM
>To: linux-programlama@liste.linux.org.tr
>Subject: Re: [Linux-programlama] thumbnail fonksiyon problemi
>
>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
>
>_______________________________________________
>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.