שינוי גודל תמונה באתר
שלום, אני בונה אתר בphp לפרויקט בלימודים. אני משתמשת בcodeigniter.
אני מנסה לבנות גלרייה של תמונות, אני מקטינה את התמונות כיוון שהן גדולות מדי על המחשב, התמונות עולות, אך בגודל המקורי שלהן.
אשמח לעזרה, אם תוכלו להסביר לי מדוע הקוד לא עובד...
זה מה שנמצא במודל-
function Gallery_model() {
//parent::CI_Model();
$this->gallery_path = realpath(APPPATH . '../images');
}
function do_upload() {
$config = array(
'allowed_types' => 'jpg|jpeg|gif|png',
'upload_path' => $this->gallery_path,
);
$this->load->library('upload', $config);
$this->upload->do_upload();
$image_data = $this->upload->data();
$config= array(
'source_image' => $image_data['full_path'],
'maintain_ration' => true,
'width' => 75,
'height' => 50
);
$this->load->library('image_lib', $config);
$this->image_lib->resize();
}
אני מתחילה בphp כך שאשמח להסבר למתחילים
תודה
שלום, אני בונה אתר בphp לפרויקט בלימודים. אני משתמשת בcodeigniter.
אני מנסה לבנות גלרייה של תמונות, אני מקטינה את התמונות כיוון שהן גדולות מדי על המחשב, התמונות עולות, אך בגודל המקורי שלהן.
אשמח לעזרה, אם תוכלו להסביר לי מדוע הקוד לא עובד...
זה מה שנמצא במודל-
function Gallery_model() {
//parent::CI_Model();
$this->gallery_path = realpath(APPPATH . '../images');
}
function do_upload() {
$config = array(
'allowed_types' => 'jpg|jpeg|gif|png',
'upload_path' => $this->gallery_path,
);
$this->load->library('upload', $config);
$this->upload->do_upload();
$image_data = $this->upload->data();
$config= array(
'source_image' => $image_data['full_path'],
'maintain_ration' => true,
'width' => 75,
'height' => 50
);
$this->load->library('image_lib', $config);
$this->image_lib->resize();
}
אני מתחילה בphp כך שאשמח להסבר למתחילים
תודה