From 3be781679c5e0825494f26df9b77fec90136f643 Mon Sep 17 00:00:00 2001 From: DRC Date: Wed, 30 Oct 2024 12:12:03 -0400 Subject: [PATCH] TJ doc: Density params require YCbCr or grayscale Since libjpeg-turbo does not support Exif, the only way it can embed density information in a JPEG image is by using the JFIF marker, which is only written if the JPEG colorspace is YCbCr or grayscale. (Referring to the conversation under #793, we may need to further restrict that to 8-bit-per-sample JPEG images, because the JFIF spec requires 8-bit data precision.) --- doc/html/group___turbo_j_p_e_g.html | 3 +++ java/doc/member-search-index.zip | Bin 1951 -> 1951 bytes java/doc/org/libjpegturbo/turbojpeg/TJ.html | 15 ++++++++++++--- java/doc/package-search-index.zip | Bin 237 -> 237 bytes java/doc/type-search-index.zip | Bin 311 -> 311 bytes java/org/libjpegturbo/turbojpeg/TJ.java | 9 +++++++++ turbojpeg.h | 9 +++++++++ 7 files changed, 33 insertions(+), 3 deletions(-) diff --git a/doc/html/group___turbo_j_p_e_g.html b/doc/html/group___turbo_j_p_e_g.html index 42c30095..3fa023fd 100644 --- a/doc/html/group___turbo_j_p_e_g.html +++ b/doc/html/group___turbo_j_p_e_g.html @@ -992,6 +992,7 @@ scalingFactor).

  • The JPEG image has (decompression) or will have (compression) the specified horizontal pixel density [default for compression: 1].
  • This value is stored in or read from the JPEG header. It does not affect the contents of the JPEG image. Note that this parameter is set by tj3LoadImage8() when loading a Windows BMP file that contains pixel density information, and the value of this parameter is stored to a Windows BMP file by tj3SaveImage8() if the value of TJPARAM_DENSITYUNITS is 2.

    +

    This parameter has no effect unless the JPEG colorspace (see TJPARAM_COLORSPACE) is TJCS_YCbCr or TJCS_GRAY.

    See also
    TJPARAM_DENSITYUNITS
    TJPARAM_YDENSITY 

    JPEG vertical pixel density.

    @@ -999,6 +1000,7 @@ scalingFactor).

  • The JPEG image has (decompression) or will have (compression) the specified vertical pixel density [default for compression: 1].
  • This value is stored in or read from the JPEG header. It does not affect the contents of the JPEG image. Note that this parameter is set by tj3LoadImage8() when loading a Windows BMP file that contains pixel density information, and the value of this parameter is stored to a Windows BMP file by tj3SaveImage8() if the value of TJPARAM_DENSITYUNITS is 2.

    +

    This parameter has no effect unless the JPEG colorspace (see TJPARAM_COLORSPACE) is TJCS_YCbCr or TJCS_GRAY.

    See also
    TJPARAM_DENSITYUNITS
    TJPARAM_DENSITYUNITS 

    JPEG pixel density units.

    @@ -1008,6 +1010,7 @@ scalingFactor).

  • 2 The pixel density of the JPEG image is expressed (decompression) or will be expressed (compression) in units of pixels/cm.
  • This value is stored in or read from the JPEG header. It does not affect the contents of the JPEG image. Note that this parameter is set by tj3LoadImage8() when loading a Windows BMP file that contains pixel density information, and the value of this parameter is stored to a Windows BMP file by tj3SaveImage8() if the value is 2.

    +

    This parameter has no effect unless the JPEG colorspace (see TJPARAM_COLORSPACE) is TJCS_YCbCr or TJCS_GRAY.

    See also
    TJPARAM_XDENSITY, TJPARAM_YDENSITY
    TJPARAM_MAXMEMORY 

    Memory limit for intermediate buffers.

    diff --git a/java/doc/member-search-index.zip b/java/doc/member-search-index.zip index ee5589b05a241774d553d7a01d437b1e3c060b0c..fc5e220a5ef07763bd830175ef600a524ec83866 100644 GIT binary patch delta 30 kcmbQwKcAmBz?+#xgn@&DgCR6IZX>S~J2Q};9K`Mm0AP>?rvLx| delta 30 kcmbQwKcAmBz?+#xgn@&DgMlqXZ6mJ}J2Q};9K`Mm092|4djJ3c diff --git a/java/doc/org/libjpegturbo/turbojpeg/TJ.html b/java/doc/org/libjpegturbo/turbojpeg/TJ.html index ea04ee2d..e4de6b7a 100644 --- a/java/doc/org/libjpegturbo/turbojpeg/TJ.html +++ b/java/doc/org/libjpegturbo/turbojpeg/TJ.html @@ -1878,7 +1878,10 @@ extends java.lang.Object

    This value is stored in or read from the JPEG header. It does not - affect the contents of the JPEG image. + affect the contents of the JPEG image. + +

    This parameter has no effect unless the JPEG colorspace (see + PARAM_COLORSPACE) is CS_YCbCr or CS_GRAY.

    See Also:
    PARAM_DENSITYUNITS, @@ -1903,7 +1906,10 @@ extends java.lang.Object

    This value is stored in or read from the JPEG header. It does not - affect the contents of the JPEG image. + affect the contents of the JPEG image. + +

    This parameter has no effect unless the JPEG colorspace (see + PARAM_COLORSPACE) is CS_YCbCr or CS_GRAY.

    See Also:
    PARAM_DENSITYUNITS, @@ -1933,7 +1939,10 @@ extends java.lang.Object

    This value is stored in or read from the JPEG header. It does not - affect the contents of the JPEG image. + affect the contents of the JPEG image. + +

    This parameter has no effect unless the JPEG colorspace (see + PARAM_COLORSPACE) is CS_YCbCr or CS_GRAY.

    See Also:
    PARAM_XDENSITY, diff --git a/java/doc/package-search-index.zip b/java/doc/package-search-index.zip index 3fae6c966c3f9f6bd5f53734373641edf5df5aa7..87217f5c232056b527aa8224eb04ed1441dd6a6e 100644 GIT binary patch delta 28 hcmaFM_?D43z?+#xgn@&DgCR6IZX$0#Gl-h+2LNRP2a*5) delta 28 hcmaFM_?D43z?+#xgn@&DgMlqXZ6a?!Gl-h+2LM{$24(;N diff --git a/java/doc/type-search-index.zip b/java/doc/type-search-index.zip index e6b014e02575271721fa4a7457ea5bf4273f594e..c23260879acaf52a4b19aa29981cfe9d57e9a8ab 100644 GIT binary patch delta 28 hcmdnaw4I4Jz?+#xgn@&DgCR6IZX)j;W)Stp8vtC<2fqLS delta 28 hcmdnaw4I4Jz?+#xgn@&DgMlqXZ6fa-W)Stp8vs(R29p2) diff --git a/java/org/libjpegturbo/turbojpeg/TJ.java b/java/org/libjpegturbo/turbojpeg/TJ.java index cb60c29f..25730ba4 100644 --- a/java/org/libjpegturbo/turbojpeg/TJ.java +++ b/java/org/libjpegturbo/turbojpeg/TJ.java @@ -851,6 +851,9 @@ public final class TJ { *

    This value is stored in or read from the JPEG header. It does not * affect the contents of the JPEG image. * + *

    This parameter has no effect unless the JPEG colorspace (see + * {@link #PARAM_COLORSPACE}) is {@link #CS_YCbCr} or {@link #CS_GRAY}. + * * @see #PARAM_DENSITYUNITS */ public static final int PARAM_XDENSITY = 20; @@ -867,6 +870,9 @@ public final class TJ { *

    This value is stored in or read from the JPEG header. It does not * affect the contents of the JPEG image. * + *

    This parameter has no effect unless the JPEG colorspace (see + * {@link #PARAM_COLORSPACE}) is {@link #CS_YCbCr} or {@link #CS_GRAY}. + * * @see #PARAM_DENSITYUNITS */ public static final int PARAM_YDENSITY = 21; @@ -888,6 +894,9 @@ public final class TJ { *

    This value is stored in or read from the JPEG header. It does not * affect the contents of the JPEG image. * + *

    This parameter has no effect unless the JPEG colorspace (see + * {@link #PARAM_COLORSPACE}) is {@link #CS_YCbCr} or {@link #CS_GRAY}. + * * @see #PARAM_XDENSITY * @see #PARAM_YDENSITY */ diff --git a/turbojpeg.h b/turbojpeg.h index 0d505df9..5c549dee 100644 --- a/turbojpeg.h +++ b/turbojpeg.h @@ -836,6 +836,9 @@ enum TJPARAM { * Windows BMP file by #tj3SaveImage8() if the value of #TJPARAM_DENSITYUNITS * is `2`. * + * This parameter has no effect unless the JPEG colorspace (see + * #TJPARAM_COLORSPACE) is #TJCS_YCbCr or #TJCS_GRAY. + * * @see TJPARAM_DENSITYUNITS */ TJPARAM_XDENSITY, @@ -853,6 +856,9 @@ enum TJPARAM { * Windows BMP file by #tj3SaveImage8() if the value of #TJPARAM_DENSITYUNITS * is `2`. * + * This parameter has no effect unless the JPEG colorspace (see + * #TJPARAM_COLORSPACE) is #TJCS_YCbCr or #TJCS_GRAY. + * * @see TJPARAM_DENSITYUNITS */ TJPARAM_YDENSITY, @@ -874,6 +880,9 @@ enum TJPARAM { * density information, and the value of this parameter is stored to a * Windows BMP file by #tj3SaveImage8() if the value is `2`. * + * This parameter has no effect unless the JPEG colorspace (see + * #TJPARAM_COLORSPACE) is #TJCS_YCbCr or #TJCS_GRAY. + * * @see TJPARAM_XDENSITY, TJPARAM_YDENSITY */ TJPARAM_DENSITYUNITS,