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.)
This commit is contained in:
DRC
2024-10-30 12:12:03 -04:00
parent 6da05150ef
commit d7932a2709
7 changed files with 33 additions and 3 deletions

Binary file not shown.

View File

@@ -1865,7 +1865,10 @@ extends java.lang.Object</pre>
loading a Windows BMP file that contains pixel density information, and
the value of this parameter is stored to a Windows BMP file by
<a href="TJDecompressor.html#saveImage(java.lang.String,java.lang.Object,int,int,int,int,int,int)"><code>TJDecompressor.saveImage()</code></a> if the value
of <a href="#PARAM_DENSITYUNITS"><code>PARAM_DENSITYUNITS</code></a> is <code>2</code>.</div>
of <a href="#PARAM_DENSITYUNITS"><code>PARAM_DENSITYUNITS</code></a> is <code>2</code>.
<p>This parameter has no effect unless the JPEG colorspace (see
<a href="#PARAM_COLORSPACE"><code>PARAM_COLORSPACE</code></a>) is <a href="#CS_YCbCr"><code>CS_YCbCr</code></a> or <a href="#CS_GRAY"><code>CS_GRAY</code></a>.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="#PARAM_DENSITYUNITS"><code>PARAM_DENSITYUNITS</code></a>,
@@ -1895,7 +1898,10 @@ extends java.lang.Object</pre>
loading a Windows BMP file that contains pixel density information, and
the value of this parameter is stored to a Windows BMP file by
<a href="TJDecompressor.html#saveImage(java.lang.String,java.lang.Object,int,int,int,int,int,int)"><code>TJDecompressor.saveImage()</code></a> if the value
of <a href="#PARAM_DENSITYUNITS"><code>PARAM_DENSITYUNITS</code></a> is <code>2</code>.</div>
of <a href="#PARAM_DENSITYUNITS"><code>PARAM_DENSITYUNITS</code></a> is <code>2</code>.
<p>This parameter has no effect unless the JPEG colorspace (see
<a href="#PARAM_COLORSPACE"><code>PARAM_COLORSPACE</code></a>) is <a href="#CS_YCbCr"><code>CS_YCbCr</code></a> or <a href="#CS_GRAY"><code>CS_GRAY</code></a>.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="#PARAM_DENSITYUNITS"><code>PARAM_DENSITYUNITS</code></a>,
@@ -1930,7 +1936,10 @@ extends java.lang.Object</pre>
loading a Windows BMP file that contains pixel density information, and
the value of this parameter is stored to a Windows BMP file by
<a href="TJDecompressor.html#saveImage(java.lang.String,java.lang.Object,int,int,int,int,int,int)"><code>TJDecompressor.saveImage()</code></a> if the value
is <code>2</code>.</div>
is <code>2</code>.
<p>This parameter has no effect unless the JPEG colorspace (see
<a href="#PARAM_COLORSPACE"><code>PARAM_COLORSPACE</code></a>) is <a href="#CS_YCbCr"><code>CS_YCbCr</code></a> or <a href="#CS_GRAY"><code>CS_GRAY</code></a>.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="#PARAM_XDENSITY"><code>PARAM_XDENSITY</code></a>,

Binary file not shown.

Binary file not shown.

View File

@@ -873,6 +873,9 @@ public final class TJ {
* {@link TJDecompressor#saveImage TJDecompressor.saveImage()} if the value
* of {@link #PARAM_DENSITYUNITS} is <code>2</code>.
*
* <p>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;
@@ -894,6 +897,9 @@ public final class TJ {
* {@link TJDecompressor#saveImage TJDecompressor.saveImage()} if the value
* of {@link #PARAM_DENSITYUNITS} is <code>2</code>.
*
* <p>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;
@@ -920,6 +926,9 @@ public final class TJ {
* {@link TJDecompressor#saveImage TJDecompressor.saveImage()} if the value
* is <code>2</code>.
*
* <p>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
*/