switch (rd->color_type)
{
case PNG_COLOR_TYPE_PALETTE:
+ /* FIXME: add support for palette with colors */
if ((io->flags & IMAGE_COLOR_SPACE) == COLOR_SPACE_GRAYSCALE)
{
png_set_palette_to_rgb(rd->png_ptr);
case PNG_COLOR_TYPE_RGB_ALPHA:
if ((io->flags & IMAGE_COLOR_SPACE) == COLOR_SPACE_GRAYSCALE)
png_set_rgb_to_gray_fixed(rd->png_ptr, 1, 21267, 71514);
- if (!(io->flags & IMAGE_ALPHA) && (io->flags & IMAGE_PIXEL_FORMAT) != (COLOR_SPACE_RGB | IMAGE_PIXELS_ALIGNED))
- {
- if (io->flags & IMAGE_IO_USE_BACKGROUND)
- read_flags |= IMAGE_ALPHA;
- else
- png_set_strip_alpha(rd->png_ptr);
- }
+ if (!(io->flags & IMAGE_ALPHA))
+ if (io->flags & IMAGE_IO_USE_BACKGROUND)
+ read_flags |= IMAGE_ALPHA;
+ else if ((io->flags & IMAGE_PIXEL_FORMAT) != (COLOR_SPACE_RGB | IMAGE_PIXELS_ALIGNED))
+ png_set_strip_alpha(rd->png_ptr);
break;
default:
ASSERT(0);