Issue #200 Fixed DefineBitsLossless replacing

proxy translation fix
This commit is contained in:
Jindra Petk
2013-07-08 19:28:32 +02:00
parent 482bca902c
commit 5ed314d0eb
6 changed files with 10 additions and 6 deletions

View File

@@ -3041,7 +3041,7 @@ public class SWFInputStream extends InputStream {
*/
public PIX24 readPIX24() throws IOException {
PIX24 ret = new PIX24();
readUI8();
ret.reserved = readUI8();
ret.red = readUI8();
ret.green = readUI8();
ret.blue = readUI8();

View File

@@ -1658,7 +1658,7 @@ public class SWFOutputStream extends OutputStream {
* @throws IOException
*/
public void writePIX24(PIX24 value) throws IOException {
writeUI8(0);
writeUI8(value.reserved);
writeUI8(value.red);
writeUI8(value.green);
writeUI8(value.blue);

View File

@@ -19,6 +19,7 @@ package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.helpers.Helper;
import com.jpexs.decompiler.flash.tags.base.AloneTag;
import com.jpexs.decompiler.flash.tags.base.ImageTag;
import com.jpexs.decompiler.flash.types.BITMAPDATA;
@@ -32,6 +33,7 @@ import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.zip.InflaterInputStream;
import javax.imageio.ImageIO;
@@ -70,7 +72,8 @@ public class DefineBitsLosslessTag extends ImageTag implements AloneTag {
bitmapData.bitmapPixelDataPix24[pos] = new PIX24();
bitmapData.bitmapPixelDataPix24[pos].red = r;
bitmapData.bitmapPixelDataPix24[pos].green = g;
bitmapData.bitmapPixelDataPix24[pos].blue = b;
bitmapData.bitmapPixelDataPix24[pos].blue = b;
bitmapData.bitmapPixelDataPix24[pos].reserved = 0xff; //documentation says 0, but image is sometimes broken with 0, so there is 0xff, which works (maybe alpha?)
pos++;
}
}
@@ -83,7 +86,7 @@ public class DefineBitsLosslessTag extends ImageTag implements AloneTag {
zlibBitmapData = zlibOS.toByteArray();
decompressed = false;
}
@Override
public BufferedImage getImage(List<Tag> tags) {
BufferedImage bi = new BufferedImage(bitmapWidth, bitmapHeight, BufferedImage.TYPE_INT_RGB);
@@ -165,8 +168,8 @@ public class DefineBitsLosslessTag extends ImageTag implements AloneTag {
bitmapColorTableSize = sis.readUI8();
}
zlibBitmapData = sis.readBytes(sis.available());
}
}
/**
* Gets data bytes
*

View File

@@ -23,6 +23,7 @@ package com.jpexs.decompiler.flash.types;
*/
public class PIX24 {
public int reserved;
/**
* Red color value
*/