tags:

views:

427

answers:

2

Hi,

I am resizing images using the image_lib library. I define a height and width, but most of the images I am trying to resize are already smaller. Is there a way to force the size and fill the rest with white, thus making all my images the same size?

Thanks

$config['source_image'] = 'abc.jpg';
$config['new_image'] = 'def.jpg';
$config['create_thumb'] = TRUE;
$config['maintain_ratio'] = TRUE;
$config['thumb_marker'] = '';
$config['width'] = 100;
$config['height'] = 100;
$this->image_lib->initialize($config);
$this->image_lib->resize();
A: 

dont think that is possible. however, when you print the images out in your view you could do so in a div with min-width and min-height. like that the image will take up the space you and trying to define while image resizing.

stef
That is what I had done so far. I just wanted to fill it with white so that I had consistent file dimensions.
Casper
A: 

Hi, if your images are small dont try to make bigger, the CI library is not too good for this task, just make a trick with css like said stef.

Asinox