17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 2892 Views |
-
Transparent GIF's lost their transparency...

31 August 2008 at 12:44pm
Hello there!
I'm using transparent gifs on a website.
Anyway i use these files on the page, they lost the alpha channel, and the effect looks horrible.
I'm not resizing the files with the CMS, and i've tried to insert them directly on the content to double check this issue, and the problem persists...any ideas?
Regards
Eduardo
-
Re: Transparent GIF's lost their transparency...

31 August 2008 at 2:10pm
even if you just insert an image straight in the content editor it will still recreate it in GD so SilverStripe can edit it as far as I know sadly. You could try experiment with writing the link to the image in the HTML source but I still think it will try a 'resize' it even if you dont change the sizes.
Dont know if this is a bug in Silverstripe or the implementation of tinymce as to why it does this.
-
Re: Transparent GIF's lost their transparency...

4 September 2008 at 12:18pm
It is
a) a bug that the image is resampled even when you don't resize the image. This needs to be solved. This also affects animated GIFS. I think this is solved but needs to be merged into a new release; http://open.silverstripe.com/ticket/1985
b) a bug that the image looses its alpha information when you resample the image. This might be a limitation of GD. Anyone care to investigate, or file a bug at open.silverstripe.com?
-
Re: Transparent GIF's lost their transparency...

23 September 2008 at 5:49am
I have seen this bug, and I went around the bug by using PNGs - though if I had an animated GIF I'd be pretty upset about it.
I wonder if there could be a setting settable in the image chooser to select "no resample" or something like that.
-
Re: Transparent GIF's lost their transparency...

23 September 2008 at 4:28pm Last edited: 12 November 2008 3:18pm
I had to fix the same issue on one of our in-house CMS, unfortunately I don't know the internals of SS well enough or have time to patch this myself the basic idea below:
Maintain GIF transparency by getting/setting transparent color from source image and copying to destination image
// read gif information to find transparency
$fp = fopen($file_path,"rb");
$result = fread($fp,13);
$gif_version = substr($result,3,3);
$gif_colorFlag = ord(substr($result,10,1)) >> 7;
fclose($fp);
if($gif_version == '89a' && $gif_colorFlag == 1) {
$colorTransparent = imagecolortransparent($src_img);
imagepalettecopy($image,$src_img);
imagefill($image, 0, 0, $colorTransparent);
imagecolortransparent($image, $colorTransparent);
}If a dev can give this a try and patch SS that be great!
-
Re: Transparent GIF's lost their transparency...

12 November 2008 at 3:19pm
[Bump!] This is still an issue with 2.2.3 can a dev look into this please...
-
Re: Transparent GIF's lost their transparency...

12 November 2008 at 3:22pm
CodeGuerrilla, 2.2.3 has no other features then the security fix. I believe a fix is in trunk (to be 2.3) so try that out. If is still broken in that check open.silverstripe.com for an open ticket for it. If one doesn't exist, create one. This helps keep track of bugs like this for the dev team.
| 2892 Views | ||
|
Page:
1
|
Go to Top |




