mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-08 15:48:29 +00:00
when a color table item is not found the pixel should be transparent (int value = 0)
This commit is contained in:
@@ -258,7 +258,10 @@ public class DefineBitsLossless2Tag extends ImageTag implements AloneTag {
|
||||
for (int x = 0; x < bitmapWidth; x++) {
|
||||
int c = 0;
|
||||
if ((bitmapFormat == DefineBitsLossless2Tag.FORMAT_8BIT_COLORMAPPED)) {
|
||||
c = multiplyAlpha(colorMapData.colorTableRGB[colorMapData.colorMapPixelData[pos32aligned] & 0xff].toInt());
|
||||
int colorTableIndex = colorMapData.colorMapPixelData[pos32aligned] & 0xff;
|
||||
if (colorTableIndex < colorMapData.colorTableRGB.length) {
|
||||
c = multiplyAlpha(colorMapData.colorTableRGB[colorTableIndex].toInt());
|
||||
}
|
||||
}
|
||||
if ((bitmapFormat == DefineBitsLossless2Tag.FORMAT_32BIT_ARGB)) {
|
||||
c = multiplyAlpha(bitmapData.bitmapPixelData[pos].toInt());
|
||||
|
||||
@@ -162,8 +162,11 @@ public class DefineBitsLosslessTag extends ImageTag implements AloneTag {
|
||||
for (int x = 0; x < bitmapWidth; x++) {
|
||||
int c = 0;
|
||||
if (bitmapFormat == DefineBitsLosslessTag.FORMAT_8BIT_COLORMAPPED) {
|
||||
RGB color = colorMapData.colorTableRGB[colorMapData.colorMapPixelData[pos32aligned] & 0xff];
|
||||
c = color.toInt();
|
||||
int colorTableIndex = colorMapData.colorMapPixelData[pos32aligned] & 0xff;
|
||||
if (colorTableIndex < colorMapData.colorTableRGB.length) {
|
||||
RGB color = colorMapData.colorTableRGB[colorTableIndex];
|
||||
c = color.toInt();
|
||||
}
|
||||
}
|
||||
if (bitmapFormat == DefineBitsLosslessTag.FORMAT_15BIT_RGB) {
|
||||
c = new RGB(bitmapData.bitmapPixelDataPix15[pos].red * 8, bitmapData.bitmapPixelDataPix15[pos].green * 8, bitmapData.bitmapPixelDataPix15[pos].blue * 8).toInt();
|
||||
|
||||
Reference in New Issue
Block a user