Welcome Guest, Not a member yet? Register   Sign In
Crop Image_moo
#1

[eluser]Thiago Leao[/eluser]
Hi friends,

I'm currently using this crop, is "working" the crop is not getting very good.

Code:
$configLarge = array(
            'source_image' => $diretorio.$image_data['file_name'],
            'new_image' => $diretorio,
            'master_dim' => 'auto',
            'maintain_ratio' => true,
            'width' => 800,
            'height' => 600
        );          
    
        $this->load->library('image_lib');
        $this->image_lib->initialize($configLarge);
        $this->image_lib->resize();            
        $this->image_lib->clear();
        
        $configThumb = array(
            'source_image' => $image_data['full_path'],
            'new_image' => $diretorio.substr($image_data['file_name'], 0, -4).'_thumb.'.end(explode(".", $image_data['file_name'])),
            'maintain_ratio' => false,
            'master_dim' => 'auto',
            'width' => 120,
            'height' => 90
        );    
        

        $this->image_lib->initialize($configThumb);
        $this->image_lib->resize_and_crop();
        
        /*GRAVAR IMAGEM NO BANCO*/
        
        $data['id_products']             = $this->input->post('id_products');
        $data['descricao']         = $this->input->post('descricao');
        $data['thumb']            = $configThumb ['new_image'];
        $data['imagem']            = $configLarge['source_image'];

I want to put the image crop moo, could someone help me to adapt?

Code:
$this->load->library('image_moo');
$this->image_moo
->load($diretorio.substr($image_data['file_name'], 0, -4).'_thumb.'.end(explode(".", $image_data['file_name'])))
->resize_crop(120,90)
->save_dynamic();
#2

[eluser]Thiago Leao[/eluser]
anyone pls!
thanks
#3

[eluser]Mat-Moo[/eluser]
You should of posted on the Image_moo thread I would of picked it up quicker.

However there is no official image_lib routine for resize_crop apart from http://ellislab.com/forums/viewthread/159815/ which does http://i.imgur.com/vlzav.jpg;

If I save the original image, and do
Code:
$this->load->library('image_moo');
        $this->image_moo
        ->load('a1.jpg')
        ->set_jpeg_quality(100)
        ->resize_crop(70,100);
    if ($this->image_moo->errors)
        print $this->image_moo->display_errors();
    else
        $this->image_moo->save_dynamic();
I get the exactly what is expected, what is the is the issue your having?




Theme © iAndrew 2016 - Forum software by © MyBB