[eluser]Unknown[/eluser]
Hey Everyone,
Long time lurker, first time poster
I was wondering if I am missing something or if the Image manipulation class doesn't preserve png transparency when resizing and thumbnail and directly outputting it? I just end up with a black background. Using the GD2 library, here is the relevant code, that works fine (except for the transparency bit):
Code:
function index($image, $max_height=null, $max_width = null)
{
$filename = 'system/application/backup/photos/'.$image;
$config['image_library'] = 'GD2';
$config['source_image'] = $filename;
$config['width'] = (is_numeric($max_width) && $max_width != 0 ? $max_width : '');
$config['height'] = (is_numeric($max_height) && $max_height != 0 ? $max_height : '');
$config['dynamic_output'] = TRUE;
$config['maintain_ratio'] = TRUE;
$this->load->library('image_lib', $config);
if(!$this->image_lib->resize())
{
echo $this->image_lib->display_errors();
}
}
Any advice much appreciated.