| Summary: | no colorkey in surfaces loaded from *.png | ||
|---|---|---|---|
| Product: | SDL_image | Reporter: | Peter Kosyh <gl00my> |
| Component: | misc | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | minor | ||
| Priority: | P2 | ||
| Version: | unspecified | ||
| Hardware: | x86_64 | ||
| OS: | All | ||
| Attachments: | indexed png | ||
I think this is fixed, can you check it? http://hg.libsdl.org/SDL_image/rev/326a602521f2 Thanks! Thank you! I have pulled from hg and found, that image is transparent now, but, currently only white color is visible. I do not see black borders in image that i attached. Just see image in gimp, there are two colors (black, white) and transparent. While blitting i see only white. I am not sure if it is another bug? It's because there are three entries in the palette and only two distinct RGB colors. I'll have to think about the best fix for this. Okay, this is fixed! This required changes both in SDL and SDL_image. Thanks! |
Created attachment 1075 [details] indexed png While linking with SDL 2.0 (taken from hg) i got a problem. After loading indexed (not RGB!) png, i found, that SDL_GetColorKey is always returns -1. I attached png, that gives the problem. Just load it and do SDL_GetColorKey. So, while blitting such Surface we will get black background, instead of transparency. I tried to debug SDL_image, but all what i got is no SDL_COPY_COLORKEY in surface->map->info.flags just after loading from png. Of course, if i manually set colorkey with SDL_SetColorKey (for example, taking pixel from 0,0), all is fine, but without knowing png structure i can not found what color key is transparent. I have no problem with SDL 1.2. Hope, my report will help.