< prev index next >

src/java.desktop/share/classes/javax/imageio/metadata/doc-files/tiff_metadata.html

Print this page




 174 <code>ImageReader.getImageMetadata</code></li>
 175 <li>Extract the ICC profile field and its value.</li>
 176 <li>Create an <a href="../../../../java/awt/color/ICC_ColorSpace.html">
 177 ICC_ColorSpace</a> from an
 178 <a href="../../../../java/awt/color/ICC_Profile.html">
 179 ICC_Profile</a> created from the ICC profile field data
 180 using <code>ICC_Profile.getInstance(byte[])</code>.</li>
 181 <li>Create an <code>ImageTypeSpecifier</code> from the new color
 182 space using one of its factory methods which accepts an
 183 <code>ICC_ColorSpace</code>.
 184 <li>Create a compatible <a href="../../ImageReadParam.html">ImageReadParam</a>
 185 and set the <code>ImageTypeSpecifier</code> using
 186 <code>ImageReadParam.setDestinationType</code>.</li>
 187 <li>Pass the parameter object to the appropriate <code>read</code> method.</li>
 188 </ol>
 189 
 190 <p>If the inferred color space not based on the ICC Profile field is compatible
 191 with the ICC profile-based color space, then a second
 192 <code>ImageTypeSpecifier</code> derived from this inferred color
 193 space will be included in the
 194 <a href="../../../../java/util/Iterator.html">Iterator</a> returned by
 195 <code>ImageReader.getImageTypes</code>. If the iterator contains
 196 more than one type, the first one will be based on the ICC profile and the
 197 second on the inferred color space.</p>
 198 
 199 <h3><a id="MetadataIssuesRead">Metadata Issues</a></h3>
 200 
 201 By default all recognized fields in the TIFF image file directory (IFD) are
 202 loaded into the native image metadata object. Which fields are loaded may be
 203 controlled by setting which TIFF tags the reader is allowed to recognize,
 204 whether to read fields with unrecognized tags, and whether to ignore all
 205 metadata. The reader is informed to disregard all metadata as usual via the
 206 <code>ignoreMetadata</code> parameter of
 207 <code>ImageReader.setInput(Object,boolean,boolean)</code>. It is
 208 informed of which <a href="../../plugins/tiff/TIFFTag.html">TIFFTag</a>s to
 209 recognize or not to recognize via
 210 <code>TIFFImageReadParam.addAllowedTagSet(TIFFTagSet)</code> and
 211 <code>TIFFImageReadParam.removeAllowedTagSet(TIFFTagSet)</code>.
 212 If <code>ignoreMetadata</code> is <code>true</code>, then only metadata
 213 essential to reading the image will be loaded into the native image metadata
 214 object. If <code>ignoreMetadata</code> is <code>false</code>, then the reader




 174 <code>ImageReader.getImageMetadata</code></li>
 175 <li>Extract the ICC profile field and its value.</li>
 176 <li>Create an <a href="../../../../java/awt/color/ICC_ColorSpace.html">
 177 ICC_ColorSpace</a> from an
 178 <a href="../../../../java/awt/color/ICC_Profile.html">
 179 ICC_Profile</a> created from the ICC profile field data
 180 using <code>ICC_Profile.getInstance(byte[])</code>.</li>
 181 <li>Create an <code>ImageTypeSpecifier</code> from the new color
 182 space using one of its factory methods which accepts an
 183 <code>ICC_ColorSpace</code>.
 184 <li>Create a compatible <a href="../../ImageReadParam.html">ImageReadParam</a>
 185 and set the <code>ImageTypeSpecifier</code> using
 186 <code>ImageReadParam.setDestinationType</code>.</li>
 187 <li>Pass the parameter object to the appropriate <code>read</code> method.</li>
 188 </ol>
 189 
 190 <p>If the inferred color space not based on the ICC Profile field is compatible
 191 with the ICC profile-based color space, then a second
 192 <code>ImageTypeSpecifier</code> derived from this inferred color
 193 space will be included in the
 194 <a href="../../../../../java.base/java/util/Iterator.html">Iterator</a> returned by
 195 <code>ImageReader.getImageTypes</code>. If the iterator contains
 196 more than one type, the first one will be based on the ICC profile and the
 197 second on the inferred color space.</p>
 198 
 199 <h3><a id="MetadataIssuesRead">Metadata Issues</a></h3>
 200 
 201 By default all recognized fields in the TIFF image file directory (IFD) are
 202 loaded into the native image metadata object. Which fields are loaded may be
 203 controlled by setting which TIFF tags the reader is allowed to recognize,
 204 whether to read fields with unrecognized tags, and whether to ignore all
 205 metadata. The reader is informed to disregard all metadata as usual via the
 206 <code>ignoreMetadata</code> parameter of
 207 <code>ImageReader.setInput(Object,boolean,boolean)</code>. It is
 208 informed of which <a href="../../plugins/tiff/TIFFTag.html">TIFFTag</a>s to
 209 recognize or not to recognize via
 210 <code>TIFFImageReadParam.addAllowedTagSet(TIFFTagSet)</code> and
 211 <code>TIFFImageReadParam.removeAllowedTagSet(TIFFTagSet)</code>.
 212 If <code>ignoreMetadata</code> is <code>true</code>, then only metadata
 213 essential to reading the image will be loaded into the native image metadata
 214 object. If <code>ignoreMetadata</code> is <code>false</code>, then the reader


< prev index next >