0

When I am creating thumbnail in codeigniter I get an image with black background color.

Why did it happen? This is the code in controller:

$this->load->library('image_lib');
                $config['image_library'] = 'gd2';
                $config['source_image'] = $file ;
                $config['maintain_ratio'] = FALSE;
                $this->image_lib->initialize($config);
                $this->md_image->resize_image('./images/logo_images/'.$filename,380,80,'./images/logo_images/thumbs/'.$filename);
ozil
  • 6,930
  • 9
  • 33
  • 56
Mas User
  • 166
  • 1
  • 5
  • 17

1 Answers1

0

It is a PHP and GD2 problem, and not taken into account in the Image Lib in CodeIgniter.

Have a look here in the PHP manual to be able to keep transparency on resize :

http://www.php.net/manual/en/function.imagecolortransparent.php

Stéph