Ver Mensaje Individual
  #2 (permalink)  
Antiguo 16/02/2011, 12:37
Avatar de Copia
Copia
 
Fecha de Ingreso: noviembre-2009
Mensajes: 309
Antigüedad: 14 años, 5 meses
Puntos: 4
Respuesta: procesar imagenes con Codeigniter y Doctrine?

Bueno hize unos cambios a esta clase y le quite todo lo que tenga que ver con Model de CI. y lo deje así:
Código PHP:
Ver original
  1. <?php
  2. class Gallery_model{
  3.  
  4.     public $gallery_path;
  5.     public $gallery_path_url;
  6.  
  7.     function __construct() {
  8.         $this->gallery_path = realpath(APPPATH . "../img");
  9.         $this->gallery_path_url = base_url() . "img";
  10.     }
  11.  
  12.     function do_upload($carpeta) {        
  13.         $config = array(
  14.             'allowed_types' => 'jpg|jpeg|gif|png',
  15.             'upload_path' => $this->gallery_path."\\".$carpeta,
  16.             'max_size' => 2000
  17.         );
  18.  
  19.         $this->load->library('upload', $config);
  20.         $this->upload->do_upload();
  21.         $image_data = $this->upload->data();
  22.         $config = array(
  23.             'source_image' => $image_data['full_path'],
  24.             'new_image' => $this->gallery_path."\\".$carpeta. '/thumbs',
  25.             'maintain_ration' => true,
  26.             'width' => 160,
  27.             'height' => 180
  28.         );
  29.        
  30.         $this->load->library('image_lib', $config);
  31.         $this->image_lib->resize();
  32.         $data = $image_data["file_name"];
  33.         return $data;        
  34.     }
  35.  
  36. }

Y me dice que galery_path no esta definido.
__________________
Dejando una huella de mi existencia por la red en http://tiricaya.com