• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
not getting exact width and height in thumb image

#1
[eluser]ratna[/eluser]
i have following code. i have here width and height 50 each. but in thumb image i didn't get the same width and height. it is always lesser than the 50. i want thumb to have exact 50 width and height. please suggest.

$config['image_library'] = 'gd2';
$config2['source_image'] = './uploads1/plane.jpg';
$config2['create_thumb'] = TRUE;
$config2['maintain_ratio'] = TRUE;

$config2['width'] = 50;

$config2['height'] = 50;

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

$this->image_lib->resize();

#2
[eluser]Cro_Crx[/eluser]
This line:

Code:
$config2['maintain_ratio'] = TRUE;

Keeps the image in the original aspect ratio. If you set it to false, your image will be resized to 50x50px. Although the original aspect ratio won't be the same.

#3
[eluser]ratna[/eluser]
it worked. thank you a lot.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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