Set GIF implicit palette entries to transparent

This commit is contained in:
Nigel Tao committed 2018-05-25 17:17:57 +10:00
1 parent ae0de1d35a
commit 79d3fd64e6
2 files changed
+30

No files matched your search

+16
View File
@@ -175,6 +175,14 @@ pri func decoder.decode_lsd?(src base.io_reader)() {
this.palettes[0][(4 * i) + 3] = 0xFF
i += 1
}
// Set the remaining palette entries to transparent black.
while i < 256 {
this.palettes[0][(4 * i) + 0] = 0x00
this.palettes[0][(4 * i) + 1] = 0x00
this.palettes[0][(4 * i) + 2] = 0x00
this.palettes[0][(4 * i) + 3] = 0x00
i += 1
}
}
}
@@ -357,6 +365,14 @@ pri func decoder.decode_id_part1?(ib ptr base.image_buffer, dst base.io_writer,
this.palettes[1][(4 * i) + 3] = 0xFF
i += 1
}
// Set the remaining palette entries to transparent black.
while i < 256 {
this.palettes[1][(4 * i) + 0] = 0x00
this.palettes[1][(4 * i) + 1] = 0x00
this.palettes[1][(4 * i) + 2] = 0x00
this.palettes[1][(4 * i) + 3] = 0x00
i += 1
}
}
// Other GIF implementations accept GIF files that aren't completely spec