25-10-2009, 09:45
|
|
|
חבר מתאריך: 12.08.05
הודעות: 883
|
|
אין לי גישה לקובץ php.ini..אולי אפשר להגדיר את זה דרך haccsess.?
אני משנה לו את הגודל בהתאם לצרכים באתר שלי..זה הקוד:
קוד PHP:
if (!empty($_FILES['pic']['name'])) { $dir = "uploads/images_users/"; $thumb_dir = "uploads/thumb/"; $upl = $dir . $member['id'] . "." . $pic_type; $thumb_upl = $thumb_dir . $member['id'] . "." . $pic_type; move_uploaded_file($_FILES['pic']['tmp_name'] , $upl); move_uploaded_file($_FILES['pic']['tmp_name'] , $thumb_upl); } list($width, $height) = getimagesize($upl); $new_width = 142; $new_height = 142; $thumb_width = 37; $thumb_height = 37; if($width > $height) { $new_height = 142 / $width * $height; $thumb_height = 37 / $thumb_width * $thumb_height; } else { $new_height = 142 / $width * $height; $thumb_width = 37 / $thumb_height * $thumb_width; } $img = imagecreatetruecolor($new_width, $new_height); $thumb = imagecreatetruecolor($thumb_width, $thumb_height); $imagecreate_type = "imagecreatefrom".$pic_type; $source = $imagecreate_type($upl); $thumb_source = $imagecreate_type($upl); imagecopyresized($img, $source, 0, 0, 0, 0, $new_width, $new_height, $width, $height); imagecopyresized($thumb, $thumb_source, 0, 0, 0, 0, $thumb_width, $thumb_height, $width, $height); $remove_img_obj = new members; $remove_img_obj->remove_member_pic(); $image_create = "image".$pic_type; $image_create($img,$upl); $image_create($thumb,$thumb_upl);
|