Welcome Guest, Not a member yet? Register   Sign In
Manipulating transparent images causes "blackness"
#1

[eluser]crispyslice[/eluser]
When the image manipulation class is used to resize images with transparency, any transparency in the image is replaced with black. I found a fix on these forums which basically consists of adding this to the image manipulation class:
Code:
$transparent_index = imagecolortransparent($src_img);
        if ($transparent_index >= 0) {
            imagepalettecopy($src_img, $dst_img);
            imagefill($dst_img, 0, 0, $transparent_index);
            imagecolortransparent($dst_img, $transparent_index);
            imagetruecolortopalette($dst_img, true, 256);
        }

I think it would be beneficial to CodeIgniter if this was fixed in the official release, and didn't require a hack to get it working properly.

This issue is present in 1.7.1, and I included an example of a resized image with transparency for reference.


Messages In This Thread
Manipulating transparent images causes "blackness" - by El Forum - 04-15-2009, 05:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB