diff --git a/doc/html/group___turbo_j_p_e_g.html b/doc/html/group___turbo_j_p_e_g.html index eea39969..75321f91 100644 --- a/doc/html/group___turbo_j_p_e_g.html +++ b/doc/html/group___turbo_j_p_e_g.html @@ -3173,7 +3173,7 @@ If you choose option 1, then *jpegSize should be set to the size of dstBufspointer to an array of n byte buffers. dstBufs[i] will receive a JPEG image that has been transformed using the parameters in transforms[i]. TurboJPEG has the ability to reallocate the JPEG destination buffer to accommodate the size of the transformed JPEG image. Thus, you can choose to:
  1. pre-allocate the JPEG destination buffer with an arbitrary size using tj3Alloc() and let TurboJPEG grow the buffer as needed,
  2. set dstBufs[i] to NULL to tell TurboJPEG to allocate the buffer for you, or
  3. -
  4. pre-allocate the buffer to a "worst case" size determined by calling tj3JPEGBufSize() with the transformed or cropped width and height and the level of subsampling used in the source image. Under normal circumstances, this should ensure that the buffer never has to be re-allocated. (Setting TJPARAM_NOREALLOC guarantees that it won't be.) Note, however, that there are some rare cases (such as transforming images with a large amount of embedded Exif or ICC profile data) in which the transformed JPEG image will be larger than the worst-case size, and TJPARAM_NOREALLOC cannot be used in those cases.
  5. +
  6. pre-allocate the buffer to a "worst case" size determined by calling tj3JPEGBufSize() with the transformed or cropped width and height and the level of subsampling used in the destination image. Under normal circumstances, this should ensure that the buffer never has to be re-allocated. (Setting TJPARAM_NOREALLOC guarantees that it won't be.) Note, however, that there are some rare cases (such as transforming images with a large amount of embedded Exif or ICC profile data) in which the transformed JPEG image will be larger than the worst-case size, and TJPARAM_NOREALLOC cannot be used in those cases.
If you choose option 1, then dstSizes[i] should be set to the size of your pre-allocated buffer. In any case, unless you have set TJPARAM_NOREALLOC, you should always check dstBufs[i] upon return from this function, as it may have changed. dstSizespointer to an array of n size_t variables that will receive the actual sizes (in bytes) of each transformed JPEG image. If dstBufs[i] points to a pre-allocated buffer, then dstSizes[i] should be set to the size of the buffer. Upon return, dstSizes[i] will contain the size of the transformed JPEG image (in bytes.) diff --git a/java/doc/member-search-index.zip b/java/doc/member-search-index.zip index 98e81569..a67ea75c 100644 Binary files a/java/doc/member-search-index.zip and b/java/doc/member-search-index.zip differ diff --git a/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html b/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html index 96edfecc..7a66c201 100644 --- a/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html +++ b/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html @@ -869,7 +869,7 @@ implements java.io.Closeable subsampling in the JPEG image (see TJ.PARAM_SUBSAMP.) The cropping region should be specified relative to the scaled image dimensions. Unless croppingRegion is TJ.UNCROPPED, - the JPEG header must be read (see setSourceImage(byte[], int) + the JPEG header must be read (see setSourceImage(byte[], int)) prior to calling this method.
Throws:
TJException
diff --git a/java/doc/org/libjpegturbo/turbojpeg/TJTransformer.html b/java/doc/org/libjpegturbo/turbojpeg/TJTransformer.html index 440d153c..b767e6de 100644 --- a/java/doc/org/libjpegturbo/turbojpeg/TJTransformer.html +++ b/java/doc/org/libjpegturbo/turbojpeg/TJTransformer.html @@ -379,7 +379,7 @@ extends TJ.bufSize() to determine the maximum size for each buffer based on the transformed or cropped width and height and the level - of subsampling used in the source image. + of subsampling used in the destination image.
transforms - an array of TJTransform instances, each of which specifies the transform parameters and/or cropping region for the corresponding transformed JPEG image
diff --git a/java/doc/package-search-index.zip b/java/doc/package-search-index.zip index 02afb3a3..3b023f20 100644 Binary files a/java/doc/package-search-index.zip and b/java/doc/package-search-index.zip differ diff --git a/java/doc/type-search-index.zip b/java/doc/type-search-index.zip index 43b6eb73..381ebb0c 100644 Binary files a/java/doc/type-search-index.zip and b/java/doc/type-search-index.zip differ diff --git a/java/org/libjpegturbo/turbojpeg/TJDecompressor.java b/java/org/libjpegturbo/turbojpeg/TJDecompressor.java index 23da0321..58a6d9bc 100644 --- a/java/org/libjpegturbo/turbojpeg/TJDecompressor.java +++ b/java/org/libjpegturbo/turbojpeg/TJDecompressor.java @@ -263,7 +263,7 @@ public class TJDecompressor implements Closeable { * subsampling in the JPEG image (see {@link TJ#PARAM_SUBSAMP}.) The * cropping region should be specified relative to the scaled image * dimensions. Unless croppingRegion is {@link TJ#UNCROPPED}, - * the JPEG header must be read (see {@link #setSourceImage(byte[], int)} + * the JPEG header must be read (see {@link #setSourceImage(byte[], int)}) * prior to calling this method. */ @SuppressWarnings("checkstyle:HiddenField") diff --git a/java/org/libjpegturbo/turbojpeg/TJTransformer.java b/java/org/libjpegturbo/turbojpeg/TJTransformer.java index 4d46b5a1..84bf3dfc 100644 --- a/java/org/libjpegturbo/turbojpeg/TJTransformer.java +++ b/java/org/libjpegturbo/turbojpeg/TJTransformer.java @@ -89,7 +89,7 @@ public class TJTransformer extends TJDecompressor { * transformed using the parameters in transforms[i]. Use * {@link TJ#bufSize TJ.bufSize()} to determine the maximum size for each * buffer based on the transformed or cropped width and height and the level - * of subsampling used in the source image. + * of subsampling used in the destination image. * * @param transforms an array of {@link TJTransform} instances, each of * which specifies the transform parameters and/or cropping region for the diff --git a/turbojpeg.h b/turbojpeg.h index e9de751f..934e4b05 100644 --- a/turbojpeg.h +++ b/turbojpeg.h @@ -2065,13 +2065,13 @@ DLLEXPORT int tj3DecodeYUV8(tjhandle handle, const unsigned char *srcBuf, * you, or * -# pre-allocate the buffer to a "worst case" size determined by calling * #tj3JPEGBufSize() with the transformed or cropped width and height and the - * level of subsampling used in the source image. Under normal circumstances, - * this should ensure that the buffer never has to be re-allocated. (Setting - * #TJPARAM_NOREALLOC guarantees that it won't be.) Note, however, that there - * are some rare cases (such as transforming images with a large amount of - * embedded Exif or ICC profile data) in which the transformed JPEG image will - * be larger than the worst-case size, and #TJPARAM_NOREALLOC cannot be used in - * those cases. + * level of subsampling used in the destination image. Under normal + * circumstances, this should ensure that the buffer never has to be + * re-allocated. (Setting #TJPARAM_NOREALLOC guarantees that it won't be.) + * Note, however, that there are some rare cases (such as transforming images + * with a large amount of embedded Exif or ICC profile data) in which the + * transformed JPEG image will be larger than the worst-case size, and + * #TJPARAM_NOREALLOC cannot be used in those cases. * . * If you choose option 1, then `dstSizes[i]` should be set to the size of your * pre-allocated buffer. In any case, unless you have set #TJPARAM_NOREALLOC,