mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-20 08:47:28 +01:00
Set GIF implicit palette entries to transparent
This commit is contained in:
1 parent
ae0de1d35a
commit
79d3fd64e6
2 files changed
+30
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user