• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A question about image resize

#1
[eluser]alanees[/eluser]
Hello all

I try use next code fro image resize :

in controller page :
Code:
function index()

    {


                $path = 'uploads/myimage.jpg';

                $config['image_library'] = 'gd2';
                $config['source_image'] = $path;
                $config['create_thumb'] = TRUE;
                $config['maintain_ratio'] = TRUE;
                $config['width'] = 300;
                $config['height'] = 160;

                $this->load->library('image_lib', $config);
                $this->image_lib->resize();





        $data['css'] = $this->css;


        $this->load->view('index',$data);

    }
but i need know what i must to write into view page for image show with new width & height

#2
[eluser]eoinmcg[/eluser]
you mean you want the location of the resized image? if so it'll be renamed to uploads/myimage_thumb.jpg

if you want to find the dimensions of a resize image you could do something like this:
Code:
$filename = 'uploads/myimage_thumb.jpg';

list($width, $height) = getimagesize($filename);

#3
[eluser]alanees[/eluser]
Thank you eoinmcg

I really want to use the getimagesize function
But when used on localhost, the browser can not open the page (like loop)


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.