[eluser]ludo31[/eluser]
hello , I would like to use this application jqZoom
http://www.mind-projects.it/projects/jqzoom/
it 's about zoom with image and to adapt that with my CI project . the work passes in 2 times : we load the image (sometimes big size ) as you see in the example the sizes are (663x447)(1097x823) etc and once upload ; Codeigniter create thumbs (small size ) but I would like to know how to configure thumbnails and the upload in order that the image has been shown correctly , because I 'm afraid that some images exceed the space that I allow for them
I would like to know your advice about this code if I do it well or there is mistakes :
I suppose that user can load the image size that they want :
Code:
$config['upload_path'] = './image/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '0';
$config['max_width'] = '0';
$config['max_height'] = '0';
$config['encrypt_name'] = true ;
$this->load->library('upload', $config);
if ( ! $this->upload->do_upload())
{
$error = array('error' => $this->upload->display_errors());
$this->load->view('image_view', $error);
}
else
{
// $data = array('upload_data' => $this->upload->data());
$data = $this->upload->data();
// print_r($data);exit ;
$this->load->view('upload_success', $data);
$source = element('full_path',$data);
$config['image_library'] = 'gd2';
$config['source_image'] = $source;
$config['new_image'] = './image/thumbs/';
$config['create_thumb'] = TRUE;
$config['thumb_marker']='';
$config['maintain_ratio'] = TRUE;
$config['width'] = 350;
$config['height'] = 225;
$this->load->library('image_lib', $config);
$this->image_lib->resize();
$nom_path = element('file_name',$data);
// echo $nom_path ;
// echo ('identifiant '.$identifiant_chaussure) ; exit ;
$this->site_model->ajoutImages($nom_path , $identifiant_chaussure);
I fix thumb width and height 350x225 because in the JQzoom example the images are the same !! and in the js JQzoom
Code:
$(document).ready(function(){
$(".jqzoom").jqueryzoom({
xzoom: 300, //zooming div default width(default width value is 200)
yzoom: 300, //zooming div default width(default height value is 200)
offset: 40, //zooming div default offset(default offset value is 10)
position: "right", //zooming div position(default position value is "right")
preload: 1 , // preload of images :1 by default
lens:1 // lens over the image 1 by default
});
});
and finally , I would like to know the real role of maintain_ratio what is change if we make it in false instead of true !!
in my case we maintain it in true ?????
thanks your suggestion is welcome !!
thanks