Issue #328 Bugged replacing DefineBitsJPEG3/4Tag image

This commit is contained in:
Jindra Petk
2013-08-24 15:13:01 +02:00
parent 29a244942b
commit eb07a8b93a
2 changed files with 3 additions and 17 deletions

View File

@@ -52,15 +52,8 @@ public class DefineBitsJPEG3Tag extends ImageTag implements AloneTag {
byte ba[] = new byte[image.getWidth() * image.getHeight()];
for (int i = 0; i < ba.length; i++) {
ba[i] = (byte) 255;
}
ByteArrayOutputStream baos = new ByteArrayOutputStream();
SWFOutputStream sos = new SWFOutputStream(baos, SWF.DEFAULT_VERSION);
try {
sos.writeBytesZlib(ba);
} catch (IOException ex) {
Logger.getLogger(DefineBitsJPEG3Tag.class.getName()).log(Level.SEVERE, null, ex);
}
bitmapAlphaData = baos.toByteArray();
}
bitmapAlphaData = ba;
} else {
bitmapAlphaData = new byte[0];
}

View File

@@ -68,14 +68,7 @@ public class DefineBitsJPEG4Tag extends ImageTag implements AloneTag {
for (int i = 0; i < ba.length; i++) {
ba[i] = (byte) 255;
}
ByteArrayOutputStream baos = new ByteArrayOutputStream();
SWFOutputStream sos = new SWFOutputStream(baos, SWF.DEFAULT_VERSION);
try {
sos.writeBytesZlib(ba);
} catch (IOException ex) {
Logger.getLogger(DefineBitsJPEG4Tag.class.getName()).log(Level.SEVERE, null, ex);
}
bitmapAlphaData = baos.toByteArray();
bitmapAlphaData = ba;
} else {
bitmapAlphaData = new byte[0];
}