Fix allowing alpha channel if layer is converted from indexed image (fix #3073)

This commit is contained in:
Joshua Ogunyinka 2021-11-29 17:18:56 +04:00 committed by David Capello
parent e7575f2373
commit f567805591

View File

@ -276,8 +276,13 @@ Image* convert_pixel_format(
if (!is_background && c == image->maskColor())
*dst_it = rgba(0, 0, 0, 0);
else
*dst_it = palette->getEntry(c);
else {
const uint32_t p = palette->getEntry(c);
if (is_background)
*dst_it = rgba(rgba_getr(p), rgba_getg(p), rgba_getb(p), 255);
else
*dst_it = p;
}
}
ASSERT(dst_it == dst_end);
break;