Is it even a simplification if it's using less common syntax like this?
main
Isaiah Odhner 2021-07-10 16:27:38 -04:00
parent afd5c7275d
commit 7af49b0185
1 changed files with 2 additions and 2 deletions

View File

@ -2865,8 +2865,8 @@ function read_image_file(blob, callback) {
if (tabs.PLTE && tabs.PLTE.length >= 3 * 2 && ctype === 3 /* palettized */) {
if (tabs.PLTE.length === 3 * 2) {
palette = make_monochrome_palette(
[...tabs.PLTE.slice(0, 3), (tabs.tRNS && tabs.tRNS.length >= 1) ? tabs.tRNS[0] : 255],
[...tabs.PLTE.slice(3, 6), (tabs.tRNS && tabs.tRNS.length >= 2) ? tabs.tRNS[1] : 255]
[...tabs.PLTE.slice(0, 3), tabs.tRNS?.[0] ?? 255],
[...tabs.PLTE.slice(3, 6), tabs.tRNS?.[1] ?? 255]
);
monochrome = true;
} else {