This could result in a 4 channel paletted image with some random
alpha channel.
CPAN #132237
for (ch = 0; ch < 3; ++ch) {
quant->mc_colors[i].channel[ch] = colors[i].rgb[ch];
}
+ quant->mc_colors[i].rgba.a = 255;
}
quant->mc_count = out;
}
for (ch = 0; ch < 3; ++ch) {
quant->mc_colors[part_num].channel[ch] = sums[ch] / workpart->pixels;
}
+ quant->mc_colors[part_num].rgba.a = 255;
}
quant->mc_count = color_count;
}
"check error message");
}
+{
+ # https://rt.cpan.org/Ticket/Display.html?id=132237
+ # a 4 channel opaque image with a default to_paletted would
+ # return palette values with non-max alpha values
+ my $im = test_image()->convert(preset => 'addalpha')->to_paletted;
+ my @col = $im->getcolors;
+ is($im->getchannels, 4, "still 4 channels");
+ is($col[0]->alpha, 255, "should have a 255 alpha");
+}
+
Imager->close_log;
done_testing();