Welcome Guest, Not a member yet? Register   Sign In
preserve transparence on image thumbnails
#1

[eluser]Unknown[/eluser]
FileConfusedystem/libraries/Image_lib.php Line:516

...
Code:
/* for PNG images*/
        if ($this->image_library == 'gd2' AND $this->image_type == 3)
        {
            imagealphablending($dst_img, false);
            $transparent = imagecolorallocatealpha($dst_img, 255, 255, 255, 127);
            imagefilledrectangle($dst_img, 0, 0, $this->width, $this->height, $transparent);
            imagesavealpha($dst_img,true);
        }

/* for GIF images */
        if ($this->image_library == 'gd2' AND $this->image_type == 1)
        {
            $transparent_index = imagecolortransparent($src_img);
            if ($transparent_index >= 0)
            {
                $transparent_color = imagecolorsforindex($src_img, $transparent_index);
                $transparent_index = imagecolorallocate($dst_img, $transparent_color['red'],
                                                              $transparent_color['green'],
                                                              $transparent_color['blue']);
                imagefill($dst_img, 0, 0, $transparent_index);
                imagecolortransparent($dst_img, $transparent_index);
            }
        }
...
#2

[eluser]steelaz[/eluser]
You should probably submit pull request on Bitbucket to get it implemented in core library.




Theme © iAndrew 2016 - Forum software by © MyBB