Codeigniter - Bild Hochladen, thumbnail generieren, speichern Sie beide Verzeichnisse in der Datenbank

Dies ist mein Modell:

Ich erhalte die folgende Fehlermeldung

 Fatal error: Call to undefined method CI_Image_lib::data() in C:\xampp\htdocs\adcc\application\models\media_model.php on line 58

Meine Frage: Warum kann ich nicht mit Daten (), um die ['vollständiger_pfad'] aus den gespeicherten Miniaturansichten (wie ich für den upload)?

Gibt es einen besseren Weg, dies zu tun? Danke!

public function set_media() {

        $config1 = array(
            'allowed_types' => 'jpg|jpeg|gif|png',
            'upload_path' => $this->gallery_path . '/images',
            'max_size' => 2048
        );

        $this->load->library('upload');
        $this->upload->initialize($config1);
        $this->upload->do_upload();

        $image_data = $this->upload->data();

        $config2 = array(
            'source_image' => $image_data['full_path'],
            'new_image' => $this->gallery_path . '/thumbs',
            'maintain_ratio' => true,
            'width' => 150,
            'height' => 100
        );

        $this->load->library('image_lib', $config2);
        $this->image_lib->resize();
        $image_data2 = $this->image_lib->data();

        $this->load->helper('url');

        $id = url_title($this->input->post('title'), 'dash', TRUE);

        $data = array(
            'id' => $id,
            'name' => $this->input->post('name'),
            'link' => $this->input->post('link'),
            'year' => $this->input->post('year'),
            'actors' => $this->input->post('actors'),
            'image' => $image_data['full_path'],
            'thumb' => $image_data2['full_path']
        );

        return $this->mongo_db->insert('media', $data);
    }
InformationsquelleAutor Nicolas Hung | 2013-04-21
Schreibe einen Kommentar