resize, keeping ratio, fill space with color

See all posts Reply

resize, keeping ratio, fill space with color new!
by temardo, 17 years, 5 months ago
i dont want to crop a pic, but fit in specific x and y with keeping the ratio and the space filled with a specific color.

example:
- target pic-size 100x70
- pic is resized (by keeping ratio) to 100x50. then it should be centered in y and the space (10px over and under the image) should be filled with red...

is this function included in the class?Reply
Re: resize, keeping ratio, fill space with color new!
by colin, 17 years, 5 months ago
Not tested, but try that. It requires version 0.21RC:

$foo->image_convert      = 'jpg';
$foo->image_resize       = true;
$foo->image_ratio_crop   = true;
$foo->image_x            = 100;
$foo->image_y            = 50;
$foo->image_border       = '10 0';
$foo->image_border_color = '#FF0000'; 
Reply