TJCompressor.compress(): Fix lossls buf size calc

This commit is contained in:
DRC
2024-08-23 12:48:01 -04:00
parent 0acb084464
commit de4bbac55e
2 changed files with 7 additions and 0 deletions

View File

@@ -485,6 +485,8 @@ public class TJCompressor implements Closeable {
} else {
checkSubsampling();
int subsamp = get(TJ.PARAM_SUBSAMP);
if (get(TJ.PARAM_LOSSLESS) == 1 && subsamp != TJ.SAMP_GRAY)
subsamp = TJ.SAMP_444;
buf = new byte[TJ.bufSize(srcWidth, srcHeight, subsamp)];
}
compress(buf);