TJCompressor.compress(): Fix lossls buf size calc
This commit is contained in:
@@ -28,6 +28,11 @@ unless the `-precision` option was specified before the `-lossless` option.
|
|||||||
calling applications to generate 12-bit-per-sample arithmetic-coded lossy JPEG
|
calling applications to generate 12-bit-per-sample arithmetic-coded lossy JPEG
|
||||||
images using the TurboJPEG API.
|
images using the TurboJPEG API.
|
||||||
|
|
||||||
|
5. Fixed an error ("Destination buffer is not large enough") that occurred when
|
||||||
|
attempting to generate a full-color lossless JPEG image using the TurboJPEG
|
||||||
|
Java API's `byte[] TJCompressor.compress()` method if the value of
|
||||||
|
`TJ.PARAM_SUBSAMP` was not `TJ.SAMP_444`.
|
||||||
|
|
||||||
|
|
||||||
3.0.3
|
3.0.3
|
||||||
=====
|
=====
|
||||||
|
|||||||
@@ -485,6 +485,8 @@ public class TJCompressor implements Closeable {
|
|||||||
} else {
|
} else {
|
||||||
checkSubsampling();
|
checkSubsampling();
|
||||||
int subsamp = get(TJ.PARAM_SUBSAMP);
|
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)];
|
buf = new byte[TJ.bufSize(srcWidth, srcHeight, subsamp)];
|
||||||
}
|
}
|
||||||
compress(buf);
|
compress(buf);
|
||||||
|
|||||||
Reference in New Issue
Block a user