[DEV] set game working

This commit is contained in:
Edouard DUPIN 2021-05-27 00:17:48 +02:00
parent 427607da70
commit fe0e00a356

View File

@ -82,9 +82,9 @@ class PngEncoderLogic {
final byte[] scanlineBytes;
if (bufferedImage.hasAlpha()) {
scanlineBytes = ToolImage.convertInByteBufferRGBA(bufferedImage);
scanlineBytes = ToolImage.pngConvertInByteBufferRGBA(bufferedImage);
} else {
scanlineBytes = ToolImage.convertInByteBufferRGB(bufferedImage);
scanlineBytes = ToolImage.pngConvertInByteBufferRGB(bufferedImage);
}
final int segmentMaxLengthOriginal = PngEncoderDeflaterOutputStream.getSegmentMaxLengthOriginal(scanlineBytes.length);
@ -95,10 +95,12 @@ class PngEncoderLogic {
deflaterOutputStream.write(scanlineBytes);
deflaterOutputStream.finish();
deflaterOutputStream.flush();
//deflaterOutputStream.close();
} else {
PngEncoderDeflaterOutputStream deflaterOutputStream = new PngEncoderDeflaterOutputStream(idatChunksOutputStream, compressionLevel, segmentMaxLengthOriginal);
deflaterOutputStream.write(scanlineBytes);
deflaterOutputStream.finish();
//deflaterOutputStream.close();
}
countingOutputStream.write(PngEncoderLogic.FILE_ENDING);