Welcome Guest, Not a member yet? Register   Sign In
The first resizing does not consider the maintain ratio
#1

[eluser]Unknown[/eluser]
Hi!

First, I apologize for the my bad english knowledge.
My problem is that one of the first image after the resizing does not consider the maintain ratio:

http://www.imageserve.info/img_store/201...8fda92.jpg

The second scaling problem is, they are working properly.

Code:
$this->load->library('image_lib');
        
        
        $config_small = array(
            'image_library'    => 'GD2',
            'source_image'    => 'media/covers/'.$this->Common->create_dirname($this->db->insert_id()).'/'.$this->db->insert_id().'.jpg',
            'thumb_marker'    => '-small',
            'create_thumb'    => TRUE,
            'maintain_ratio'=> TRUE,
            'width'            => 50,
            //'height'        => 300,
        );
        
        
        $this->image_lib->initialize($config_small);
        $this->image_lib->resize();
        
        
        
        $config_middle = array(
            'image_library'    => 'GD2',
            'source_image'    => 'media/covers/'.$this->Common->create_dirname($this->db->insert_id()).'/'.$this->db->insert_id().'.jpg',
            'thumb_marker'    => '-middle',
            'create_thumb'    => TRUE,            
            'maintain_ratio'=> TRUE,
            'width'            => 100,
            //'height'        => 400,
        );
        
        
        $this->image_lib->initialize($config_middle);
        $this->image_lib->resize();
        
        
        $config_large = array(
            'image_library'    => 'GD2',
            'source_image'    => 'media/covers/'.$this->Common->create_dirname($this->db->insert_id()).'/'.$this->db->insert_id().'.jpg',
            'thumb_marker'    => '-large',
            'create_thumb'    => TRUE,
            'maintain_ratio'=> TRUE,
            'width'            => 200,
            //'height'        => 120,
        );
        
        
        $this->image_lib->initialize($config_large);
        $this->image_lib->resize();

Anyone has any idea what could it be?
Thank you in advance for your help.
#2

[eluser]gvillavizar[/eluser]
I solved this same problem just yesterday, the problem is you MUST specify a height in order to maintain the ratio.




Theme © iAndrew 2016 - Forum software by © MyBB