< prev index next >

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

Print this page




 199 space using one of its factory methods which accepts an
 200 <code>ICC_ColorSpace</code>.
 201 <li>Create a compatible <a href="../../ImageReadParam.html">ImageReadParam</a>
 202 and set the <code>ImageTypeSpecifier</code> using
 203 <code>ImageReadParam.setDestinationType</code>.</li>
 204 <li>Pass the parameter object to the appropriate <code>read</code> method.</li>
 205 </ol>
 206 </p>
 207 
 208 <p>If the inferred color space not based on the ICC Profile field is compatible
 209 with the ICC profile-based color space, then a second
 210 <code>ImageTypeSpecifier</code> derived from this inferred color
 211 space will be included in the
 212 <a href="../../../../java/util/Iterator.html">Iterator</a> returned by
 213 <code>ImageReader.getImageTypes</code>. If the iterator contains
 214 more than one type, the first one will be based on the ICC profile and the
 215 second on the inferred color space.</p>
 216 
 217 <h4><a name="MetadataIssuesRead"/>Metadata Issues</h4>
 218 
 219 By default all fields in the TIFF image file directory (IFD) are loaded into
 220 the native image metadata object. In cases where the IFD includes fields which
 221 contain large amounts of data this could be very inefficient. Which fields
 222 are loaded may be controlled by setting which TIFF tags the reader is allowed
 223 to recognize and whether it is ignoring metadata. The reader is informed to
 224 disregard metadata as usual via the <code>ignoreMetadata</code> parameter of
 225 <code>ImageReader.setInput(Object,boolean,boolean)</code>. It is
 226 informed of which <a href="../../plugins/tiff/TIFFTag.html">TIFFTag</a>s to
 227 recognize or not to recognize via
 228 <code>TIFFImageReadParam.addAllowedTagSet(TIFFTagSet)</code>
 229 and
 230 <code>TIFFImageReadParam.removeAllowedTagSet(TIFFTagSet)</code>.
 231 If <code>ignoreMetadata</code> is <code>true</code>, then the reader will
 232 load into the native image metadata object only those fields which have a
 233 <code>TIFFTag</code> contained in the one of the allowed
 234 <code>TIFFTagSet</code>s.






 235 
 236 <p>Use of a <a href="../../plugins/tiff/TIFFDirectory.html">TIFFDirectory</a>
 237 object may simplify gaining access to metadata values. An instance of
 238 <code>TIFFDirectory</code> may be created from the <code>IIOMetadata</code>
 239 object returned by the TIFF reader using the
 240 <code>TIFFDirectory.createFromMetadata</code> method.</p>
 241 
 242 <h5><a name="MapNativeStandard"/>
 243 Mapping of TIFF Native Image Metadata to the Standard Metadata Format</h5>
 244 
 245 The derivation of standard metadata format
 246 <a href="standard_metadata.html">javax_imageio_1.0</a>
 247 elements from <a href="#ImageMetadata">TIFF native image metadata</a> is given
 248 in the following table.
 249 
 250 <p>
 251 <table border="1">
 252 <tr>
 253 <th>Standard Metadata Element</th>
 254 <th>Derivation from TIFF Fields</th>




 199 space using one of its factory methods which accepts an
 200 <code>ICC_ColorSpace</code>.
 201 <li>Create a compatible <a href="../../ImageReadParam.html">ImageReadParam</a>
 202 and set the <code>ImageTypeSpecifier</code> using
 203 <code>ImageReadParam.setDestinationType</code>.</li>
 204 <li>Pass the parameter object to the appropriate <code>read</code> method.</li>
 205 </ol>
 206 </p>
 207 
 208 <p>If the inferred color space not based on the ICC Profile field is compatible
 209 with the ICC profile-based color space, then a second
 210 <code>ImageTypeSpecifier</code> derived from this inferred color
 211 space will be included in the
 212 <a href="../../../../java/util/Iterator.html">Iterator</a> returned by
 213 <code>ImageReader.getImageTypes</code>. If the iterator contains
 214 more than one type, the first one will be based on the ICC profile and the
 215 second on the inferred color space.</p>
 216 
 217 <h4><a name="MetadataIssuesRead"/>Metadata Issues</h4>
 218 
 219 By default all recognized fields in the TIFF image file directory (IFD) are
 220 loaded into the native image metadata object. Which fields are loaded may be
 221 controlled by setting which TIFF tags the reader is allowed to recognize,
 222 whether to read fields with unrecognized tags, and whether to ignore all
 223 metadata. The reader is informed to disregard all metadata as usual via the
 224 <code>ignoreMetadata</code> parameter of
 225 <code>ImageReader.setInput(Object,boolean,boolean)</code>. It is
 226 informed of which <a href="../../plugins/tiff/TIFFTag.html">TIFFTag</a>s to
 227 recognize or not to recognize via
 228 <code>TIFFImageReadParam.addAllowedTagSet(TIFFTagSet)</code> and

 229 <code>TIFFImageReadParam.removeAllowedTagSet(TIFFTagSet)</code>.
 230 If <code>ignoreMetadata</code> is <code>true</code>, then only metadata
 231 essential to reading the image will be loaded into the native image metadata
 232 object. If <code>ignoreMetadata</code> is <code>false</code>, then the reader
 233 will by default load into the native image metadata object only those fields
 234 which are either essential to reading the image or have a <code>TIFFTag</code>
 235 contained in the one of the allowed <code>TIFFTagSet</code>s. Reading of
 236 fields with tags not in the allowed <code>TIFFTagSet</code>s may be forced
 237 by passing in a <code>TIFFImageReadParam</code> on which
 238 <code>TIFFImageReadParam.setReadUnknownTags(boolean)</code> has been
 239 invoked with parameter <code>true</code>.
 240 
 241 <p>Use of a <a href="../../plugins/tiff/TIFFDirectory.html">TIFFDirectory</a>
 242 object may simplify gaining access to metadata values. An instance of
 243 <code>TIFFDirectory</code> may be created from the <code>IIOMetadata</code>
 244 object returned by the TIFF reader using the
 245 <code>TIFFDirectory.createFromMetadata</code> method.</p>
 246 
 247 <h5><a name="MapNativeStandard"/>
 248 Mapping of TIFF Native Image Metadata to the Standard Metadata Format</h5>
 249 
 250 The derivation of standard metadata format
 251 <a href="standard_metadata.html">javax_imageio_1.0</a>
 252 elements from <a href="#ImageMetadata">TIFF native image metadata</a> is given
 253 in the following table.
 254 
 255 <p>
 256 <table border="1">
 257 <tr>
 258 <th>Standard Metadata Element</th>
 259 <th>Derivation from TIFF Fields</th>


< prev index next >