Package com.github.jaiimageio.plugins.tiff

Package containing the public classes used by the TIFF plug-in forthe Image I/O Framework.

See: Description

Package com.github.jaiimageio.plugins.tiff Description

Package containing the public classes used by the TIFF plug-in forthe Image I/O Framework.

Reading Images

Writing Images
Native Stream Metadata Format
Native Image Metadata Format

Reading Images

TIFF images are read by an ImageReader which may becontrolled by its public interface as well as via a suppliedTIFFImageReadParam.

Decompression

A TIFFDecompressor object may besupplied viaTIFFImageReadParam.setTIFFDecompressor().If a TIFFDecompressor is specifiedin this manner it will be used and will supersede any internal decompressorwhich might otherwise have been used for a known compression type. Thismechanism allows for compression types to be handled by user-defineddecompressors whether or not that compression type is known to the plug-in.

Color Conversion

A TIFFColorConverter object may besupplied viaTIFFImageReadParam.setColorConverter().If a TIFFColorConverter is specifiedin this manner it will be used and will supersede any internal color converterwhich might otherwise have been used. This color converter will be used toconvert the source image data to an RGB color space.

If no user-supplied color converter is available, the source image datahave photometric type CIE L*a*b* or YCbCr, and the destination color spacetype is RGB, then the source image data will be automatically converted toRGB using an internal color converter.

Color Spaces

The raw color space assigned by default, i.e., in the absence of auser-supplied ImageTypeSpecifier, will bethe first among the following which applies:
  • A color space created from the ICC Profilemetadata field if it is present and compatible with the image datalayout.
  • sRGB if the image is monochrome/bilevel(a two-level color map is created internally).
  • sRGB if the image is palette-color.
  • Linear RGB if the image has three samples per pixel, has photometric typeCIE L*a*b*, or has photometric type YCbCr and is notJPEG-compressed.
  • A default CMYK color space if the image hasphotometric type CMYK and four samples per pixel.
  • Grayscale if the image has one or two samples per pixel and uniformly1, 2, 4, 8, 16, or 32 bits per sample or is floating point.
  • sRGB if the image has three or four samples per pixel and uniformly1, 2, 4, 8, 16, or 32 bits per sample or is floating point.
  • A fabricated, generic color space if the imagehas more than four samples per pixel and the number of bits per sample forall bands is the same and is a multiple of 8.
  • Grayscale if the image has one or two samples per pixel regardless ofthe number of bits per sample.
  • sRGB if the image has three or four samples per pixel regardless ofthe number of bits per sample.
  • A fabricated, generic color space if the imagehas more than four samples per pixel regardless of the number of bits persample.

The normalized color coordinate transformationsused for the default CMYK color space are defined as follows:

The generic color space used when no other color spacecan be inferred is provided merely to enable the data to be loaded. It is notintended to provide accurate conversions of any kind.

If the data are known to be in a color space not correctly handled by theforegoing, then an ImageTypeSpecifier should be suppliedto the reader and should be derived from a color space which is correct forthe data in question.

ICC Profiles

If an ICC profile is contained in the image metadata(BaselineTIFFTagSet.TAG_ICC_PROFILE,tag number 34675), an attempt will be made to use it to create the color spaceof the loaded image. It will be used if the data layout is of component typeand the number of samples per pixel equals or is one greater than the numberof components described by the ICC profile. If the ICC profile is not usedthen the color space will be inferred in one of the subsequent steps describedabove.

If for some reason the embedded ICC profile is not used automatically, thenit may be used manually by following this procedure:

  1. Obtain the image metadata fromImageReader.getImageMetadata(int)
  2. Extract the ICC profile field and its value.
  3. Create an ICC_ColorSpace from anICC_Profile created from the ICC profile field datausing ICC_Profile.getInstance(byte[]).
  4. Create an ImageTypeSpecifier from the new colorspace using one of its factory methods which accepts anICC_ColorSpace.
  5. Create a compatible ImageReadParam and set theImageTypeSpecifier usingImageReadParam.setDestinationType(javax.imageio.ImageTypeSpecifier).
  6. Pass the parameter object to the appropriate read method.

If the inferred color space not based on the ICC Profile field is compatiblewith the ICC profile-based color space, then a secondImageTypeSpecifier derived from this inferred colorspace will be included in the Iterator returned byImageReader.getImageTypes(int). If the iterator containsmore than one type, the first one will be based on the ICC profile and thesecond on the inferred color space.

Metadata Issues

By default all fields in the TIFF image file directory (IFD) are loaded intothe native image metadata object. In cases where the IFD includes fields whichcontain large amounts of data this could be very inefficient. Which fieldsare loaded may be controlled by setting which TIFF tags the reader is allowedto recognize and whether it is ignoring metadata. The reader is informed todisregard metadata as usual via the ignoreMetadata parameter ofjavax.imageio.ImageReader.setInput(). It isinformed of which TIFFTags torecognize or not to recognize viaTIFFImageReadParam.addAllowedTagSet()andTIFFImageReadParam.removeAllowedTagSet().If ignoreMetadata is true, then the reader willload into the native image metadata object only those fields which have aTIFFTag contained in the one of the allowedTIFFTagSets.

Use of a TIFFDirectory objectmay simplify gaining access to metadata values. An instance ofTIFFDirectory may be created from the IIOMetadataobject returned by the TIFF reader using theTIFFDirectory.createFromMetadata() method.

Mapping of TIFF Native Image Metadata to the Standard Metadata Format
The derivation of standard metadata format javax_imageio_1.0elements from TIFF native image metadata is givenin the following table.

Standard Metadata ElementDerivation from TIFF Fields
/Chroma/ColorSpaceType@namePhotometricInterpretation: WhiteIsZero, BlackIsZero, TransparencyMask ="GRAY"; RGB, PaletteColor => "RGB"; CMYK => "CMYK";YCbCr => "YCbCr";CIELab, ICCLab => "Lab".
/Chroma/NumChannels@valueSamplesPerPixel
/Chroma/BlackIsZero@value"TRUE" <=> PhotometricInterpretation => WhiteIsZero
/Chroma/PaletteColorMap
/Compression/CompressionTypeName@valueCompression: Uncompressed => "none"; CCITT 1D => "CCITTRLE";Group 3 Fax => "CCITT T.4"; Group 4 Fax => "CCITT T.6";LZW => "LZW";JPEG => "Old JPEG"; New JPEG => "JPEG"; Zlib =>> "ZLib"; PackBits =>"PackBits";Deflate => "Deflate"; EXIF JPEG => "JPEG".
/Compression/Lossless@valueCompression: JPEG or New JPEG => "FALSE"; otherwise "TRUE".
/Data/PlanarConfiguration@valueChunky => "PixelInterleaved"; Planar => "PlaneInterleaved".
/Data/SampleFormat@valuePhotometricInterpretation PaletteColor => "Index";SampleFormat unsigned integer data => "UnsignedIntegral";SampleFormat two's complement signed integer data => "SignedIntegral";SampleFormat IEEE floating point data => "Real";otherwise element not emitted.
/Data/BitsPerSample@valueBitsPerSample as a space-separated list.
/Data/SampleMSB@valueFillOrder: left-to-right => space-separated list of BitsPerSample-1;right-to-left => space-separated list of 0s.
/Dimension/PixelAspectRatio@value(1/XResolution)/(1/YResolution)
/Dimension/ImageOrientation@valueOrientation
/Dimension/HorizontalPixelSize@value1/XResolution in millimeters if ResolutionUnit is not None.
/Dimension/VerticalPixelSize@value1/YResolution in millimeters if ResolutionUnit is not None.
/Dimension/HorizontalPosition@valueXPosition in millimeters if ResolutionUnit is not None.
/Dimension/VerticalPosition@valueYPosition in millimeters if ResolutionUnit is not None.
/Document/FormatVersion@value6.0
/Document/SubimageInterpretation@valueNewSubFileType: transparency => "TransparencyMask";reduced-resolution => "ReducedResolution";single page => "SinglePage".
/Document/ImageCreationTime@valueDateTime
/Text/TextEntryDocumentName, ImageDescription, Make, Model, PageName, Software,Artist, HostComputer, InkNames, Copyright:/Text/TextEntry@keyword = field name,/Text/TextEntry@value = field value.
Example: TIFF Software field => /Text/TextEntry@keyword = "Software",/Text/TextEntry@value = Name and version number of the software package(s)used to create the image.
/Transparency/Alpha@valueExtraSamples: associated alpha => "premultiplied";unassociated alpha => "nonpremultiplied".

Reading EXIF Images

The TIFF reader may be used to read an uncompressed EXIF image or thecontents of the APP1 marker segment of a compressed EXIF image.
Reading Uncompressed EXIF Images
An uncompressed EXIF image is a one- or two-page uncompressed TIFF imagewith a specific ordering of its IFD and image data content. Each pixelhas three 8-bit samples with photometric interpretation RGB or YCbCr.The image stream must contain a single primary image and may contain asingle thumbnail which if present must also be uncompressed. The usualImageReader methods may be used to read the imagedata and metadata:
ImageReader tiffReader;ImageInputStream input;ImageReadParam readParam;tiffReader.setInput(input);// Read primary image and IFD.BufferedImage image = tiffReader.read(0, readParam);IIOMetadata primaryIFD = tiffReader.getImageMetadata(0);// Read thumbnail and IFD if present.BufferedImage thumbnail = null;IIOMetadata thumbnailIFD = null;if(tiffReader.getNumImages(true) > 1) {    thumbnail = tiffReader.read(1, readParam);    thumbnailIFD = tiffReader.getImageMetadata(1);}
Note that the EXIF thumbnail is treated as a separate page in the TIFFstream and not as a thumbnail, i.e.,tiffReader.hasThumbnails(0) will return false.
Reading Compressed EXIF Images
A compressed EXIF image is a 3-band ISO/IEC 10918-1 baseline DCT JPEG streamwith an inserted APP1 marker segment. The parameters of the markersegment after the length are the 6-byte sequence{'E', 'x', 'i', 'f', 0x00, 0x00} followedby a complete TIFF stream. The embedded TIFF stream contains a primary IFDdescribing the JPEG image optionally followed by a thumbnail IFD andcompressed or uncompressed thumbnail image data. Note that the embedded TIFFstream does not contain any image data associated with the primary IFDnor any descriptive fields which duplicate information found in the JPEGstream itself.

The parameter content of the APP1 marker segment may be obtainedfrom the user object of the associated Node in ajavax_imageio_jpeg_image_1.0 native image metadata tree extractedfrom the image metadata object returned by the JPEG reader. This node willhave name unknown and an attribute named MarkerTag withintegral value 0xE1 (String value"225"). The primary IFD and the thumbnail IFD and image may beread from the user object by the usual ImageReadermethods:

ImageReader tiffReader;ImageReadParam readParam;IIOMetadataNode app1EXIFNode;// Set up input skipping EXIF ID 6-byte sequence.byte[] app1Params = (byte[])app1EXIFNode.getUserObject();MemoryCacheImageInputStream app1EXIFInput =    new MemoryCacheImageInputStream(new ByteArrayInputStream(app1Params, 6,                                                             app1Params.length - 6));tiffReader.setInput(app1EXIFInput);// Read primary IFD.IIOMetadata primaryIFD = tiffReader.getImageMetadata(0);// Read thumbnail and IFD if present.BufferedImage thumbnail = null;IIOMetadata thumbnailIFD = null;if(tiffReader.getNumImages(true) > 1) {    thumbnail = tiffReader.read(1, readParam);    thumbnailIFD = tiffReader.getImageMetadata(1);}
Note that tiffReader.getNumImages(true) returns the number ofIFDs in the embedded TIFF stream including those corresponding to emptyimages. Calling tiffReader.read(0, readParam) will throwan exception as the primary image in the embedded TIFF stream is alwaysempty; the primary image should be obtained using the JPEG reader itself.

Writing Images

TIFF images are written by an ImageWriter which may becontrolled by its public interface as well as via a suppliedTIFFImageWriteParam. The TIFFwriter supports many optional capabilities including writing tiled images,inserting images, writing or inserting empty images, and replacing imagedata. Pixels may be replaced in either empty or non-empty images but if andonly if the data are not compressed.

Compression

A TIFFCompressor object may besupplied viaTIFFImageWriteParam.setTIFFCompressor().If a TIFFCompressor is specifiedin this manner it will be used and will supersede any internal compressorwhich might otherwise have been used for a known compression type. Thismechanism allows for compression types to be handled by user-definedcompressors whether or not that compression type is known to the plug-in.

Color Conversion

A TIFFColorConverter object may besupplied viaTIFFImageWriteParam.setColorConverter().If a TIFFColorConverter is specifiedin this manner it will be used and will supersede any internal color converterwhich might otherwise have been used. This color converter will be used toconvert from RGB to the color space of the output image.

If no user-supplied color converter is available, the source image datacolor space type is RGB, and the destination photometric type is CIE L*a*b* orYCbCr, then the source image data will be automatically converted fromRGB using an internal color converter.

ICC Profiles

An ICC Profile field will be written if either:

Metadata Issues

Some behavior of the writer is affected by or may affect the contents ofthe image metadata which may be supplied by the user.

For bilevel images, the FillOrder, and T4Optionsfields affect the output data. The data will be filled right-to-left ifFillOrder is present with a value of 2(BaselineTIFFTagSet.FILL_ORDER_RIGHT_TO_LEFT)and will be filled left-to-right otherwise. The value of T4Optionsspecifies whether the data should be 1D- or 2D-encoded and whether EOLpadding should be used.

For all images the value of the RowsPerStrip field is usedto the set the number of rows per strip if the image is not tiled. Thedefault number of rows per strip is either 8 or the number of rows whichwould fill no more than 8 kilobytes, whichever is larger.

For all images the tile dimensions may be set using the TileWidthand TileLength field values if the tiling mode isImageWriteParam.MODE_COPY_FROM_METADATA. If this modeis set but the fields are not, their respective default values are the imagewidth and height.

When using JPEG-in-TIFF compression, a JPEGTables field will bewritten to the IFD and abbreviated JPEG streams to each strip or tile if andonly if a JPEGTables field is contained in the metadata objectprovided to the writer. If the contents of the JPEGTables field isa valid tables-only JPEG stream, then it will be used; otherwise the contentsof the field will be replaced with default visually lossless tables. If nosuch JPEGTables field is present in the metadata, then noJPEGTables field will be written to the output and each strip ortile will be written as a separate, self-contained JPEG stream.

When using Deflate/ZLib or LZW compression, if the image has 8 bits persample, a horizontal differencing predictor will be used if thePredictor field is present with a value of 2(BaselineTIFFTagSet.PREDICTOR_HORIZONTAL_DIFFERENCING). If prediction is so requested but the image does not have8 bits per sample the field will be reset to have the value 1(BaselineTIFFTagSet.PREDICTOR_NONE).

Some fields may be added or modified:

  • PhotometricInterpretation if not present or if derivedfrom a TIFFColorConverter.
  • PlanarConfiguration if this field is present with valuePlanar is is reset to Chunky.
  • Compression always.
  • BitsPerSample if the image is not bilevel.
  • SamplesPerPixel always.
  • ExtraSamples if an alpha channel is present.
  • SampleFormat if not present and the data are 16- or 32-bitintegers or floating point.
  • ColorMap if the PhotometricInterpretation isRGBPalette.
  • ImageWidth and ImageLength always.
  • TileWidth, TileLength, TileOffsets, andTileByteCounts if a tiled image is being written.
  • RowsPerStrip, StripOffsets, and StripByteCountsif a tiled image is not being written.
  • XResolution, YResolution, and ResolutionUnitif none of these is present.
  • YCbCrSubsampling and YCbCrPositioning if thephotometric interpretation is YCbCr and the compression type is not JPEG(only [1, 1] subsampling and cosited positioning are supported fornon-JPEG YCbCr output).
  • YCbCrSubsampling, YCbCrPositioning, andReferenceBlackWhite: if the compression type is JPEG and the colorspace is RGB these will be reset to [2, 2] centered subsampling with noheadroom/footroom (0:255,128:255,128:255).

Some fields may be removed:

  • BitsPerSample if the image is bilevel.
  • ExtraSamples if the image does not have an alpha channel.
  • ColorMap if the photometric interpretation is notRGBPalette.
  • TileWidth, TileLength, TileOffsets, andTileByteCounts if tiling is not being used.
  • RowsPerStrip, StripOffsets, and StripByteCountsif tiling is being used.
  • YCbCrSubsampling, YCbCrPositioning, andReferenceBlackWhite if the compression type is JPEG and thecolor space is grayscale.

Other fields present in the supplied metadata are uninterpreted and willbe written as supplied.

If an EXIF image is being written, the set of fields present and theirvalues will be modified such that the result is in accord with the EXIF 2.2specification.

Setting up the image metadata to write to a TIFF stream may be simplifiedby using the TIFFDirectory classwhich represents a TIFF IFD. A field in a TIFF IFD is represented by aninstance of TIFFField. For eachfield to be written a TIFFField may be added to theTIFFDirectory and the latter converted to anIIOMetadata object by invokingTIFFDirectory.getAsMetadata(). TheIIOMetadata object so obtained may then be passed to the TIFFwriter.

Mapping of the Standard Metadata Format to TIFF Native Image Metadata
The derivation of TIFF native image metadataelements from the standard metadata format javax_imageio_1.0 isgiven in the following table.

TIFF FieldDerivation from Standard Metadata Elements
PhotometricInterpretation/Chroma/ColorSpaceType@name: "GRAY" and /Chroma/BlackIsZero@value = "FALSE"=> WhiteIsZero; "GRAY" and /Document/SubimageInterpretation@value ="TransparencyMask" => TransparencyMask; "RGB" and /Chroma/Palette present =>PaletteColor; "GRAY" => BlackIsZero; "RGB" => RGB; "YCbCr" => YCbCr;"CMYK" => CMYK; "Lab" => CIELab.
SamplesPerPixel/Chroma/NumChannels@value
ColorMap/Chroma/Palette
Compression/Compression/CompressionTypeName@value: "none" => Uncompressed;"CCITT RLE" => CCITT 1D; "CCITT T.4" => Group 3 Fax; "CCITT T.6" => Group 4Fax; "LZW" => LZW; "Old JPEG" => JPEG; "JPEG" => New JPEG; "ZLib" => ZLib;"PackBits" => PackBits; "Deflate" => Deflate.
PlanarConfiguration/Data/PlanarConfiguration@value: "PixelInterleaved" => Chunky;"PlaneInterleaved" => Planar.
SampleFormat/Data/SampleFormat@value: "SignedIntegral" => two's complement signedinteger data; "UnsignedIntegral" => unsigned integer data; "Real" =>IEEE floating point data; "Index" => unsigned integer data.
BitsPerSample/Data/BitsPerSample@value: space-separated list parsed to char array.
FillOrder/Data/SampleMSB@value: if all values in space-separated list are 0s =>right-to-left; otherwise => left-to-right.
XResolution(10 / /Dimension/HorizontalPixelSize@value) or(10 / (/Dimension/VerticalPixelSize@value */Dimension/PixelAspectRatio@value))
YResolution(10 / /Dimension/VerticalPixelSize@value) or(10 / (/Dimension/HorizontalPixelSize@value //Dimension/PixelAspectRatio@value))
ResolutionUnitCentimeter if XResolution or YResolution set; otherwise None.
Orientation/Dimension/ImageOrientation@value
XPosition/Dimension/HorizontalPosition@value / 10
YPosition/Dimension/VerticalPosition@value / 10
NewSubFileType/Document/SubimageInterpretation@value: "TransparencyMask" =>transparency mask; "ReducedResolution" => reduced-resolution;"SinglePage" => single page.
DateTime/Document/ImageCreationTime@value
DocumentName, ImageDescription, Make, Model, PageName, Software,Artist, HostComputer, InkNames, Copyright/Text/TextEntry: if /Text/TextEntry@keyword is the name of any of theTIFF Fields, e.g., "Software", then the field is added with content/Text/TextEntry@value and count 1.
ExtraSamples/Transparency/Alpha@value: "premultiplied" => associated alpha, count 1;"nonpremultiplied" => unassociated alpha, count 1.

Writing EXIF Images

The TIFF writer may be used to write an uncompressed EXIF image or thecontents of the APP1 marker segment of a compressed EXIF image.
Writing Uncompressed EXIF Images
When writing a sequence of images each image is normally recorded as{IFD, IFD Value, Image Data}. The EXIF specification requiresthat an uncompressed EXIF image be structured as follows:
  1. Image File Header
  2. Primary IFD
  3. Primary IFD Value
  4. Thumbnail IFD
  5. Thumbnail IFD Value
  6. Thumbnail Image Data
  7. Primary Image Data
To meet the requirement of the primary image data being recorded last, theprimary image must be written initially as an empty image and have its dataadded via pixel replacement after the thumbnail IFD and image data have beenwritten:
ImageWriter tiffWriter;ImageOutputStream output;ImageWriteParam writeParam;IIOMetadata streamMetadata;BufferedImage image;BufferedImage thumbnail;IIOMetadata primaryIFD;IIOMetadata thumbnailIFD;tiffWriter.setOutput(output);if(thumbnail != null) {    // Write the TIFF header.    tiffWriter.prepareWriteSequence(streamMetadata);    // Append the primary IFD.    tiffWriter.prepareInsertEmpty(-1, // append                                  new ImageTypeSpecifier(image),                                  image.getWidth(),                                  image.getHeight(),                                  primaryIFD,                                  null, // thumbnails                                  writeParam);    tiffWriter.endInsertEmpty();    // Append the thumbnail IFD and image data.    tiffWriter.writeToSequence(new IIOImage(thumbnail, null, null),                               writeParam);    // Append the primary image data.    tiffWriter.prepareReplacePixels(0, new Rectangle(image.getWidth(),                                                     image.getHeight()));    tiffWriter.replacePixels(image, writeParam);    tiffWriter.endReplacePixels();    // End writing.    tiffWriter.endWriteSequence();} else {    // Write only the primary IFD and image data.    tiffWriter.write(streamMetadata,                     new IIOImage(image, null, primaryIFD),                     writeParam);}
Writing Compressed EXIF Images
The structure of the embedded TIFF stream in the APP1 segment of acompressed EXIF image is identical to the uncompressed EXIF image structure except that there are no primaryimage data, i.e., the primary IFD does not refer to any image data.
ImageWriter tiffWriter;ImageWriteParam writeParam;boolean isThumbnailCompressed;IIOMetadata streamMetadata;BufferedImage image;BufferedImage thumbnail;IIOMetadata primaryIFD;IIOMetadata thumbnailIFD;// Set up the output.ByteArrayOutputStream baos = new ByteArrayOutputStream();MemoryCacheImageOutputStream app1EXIFOutput = new MemoryCacheImageOutputStream(baos);tiffWriter.setOutput(app1EXIFOutput);// Set compression.writeParam.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);writeParam.setCompressionType("EXIF JPEG");if(thumbnail != null) {    // Write the TIFF header.    tiffWriter.prepareWriteSequence(streamMetadata);    // Append the primary IFD.    tiffWriter.prepareInsertEmpty(-1,  // append                                  new ImageTypeSpecifier(image),                                  image.getWidth(),                                  image.getHeight(),                                  primaryIFD,                                  null, // thumbnails                                  writeParam);    tiffWriter.endInsertEmpty();    // Change compression type if uncompressed.    if(!isThumbnailCompressed) {        writeParam.setCompressionMode(ImageWriteParam.MODE_DISABLED);    }    // Append the thumbnail IFD and image data.    tiffWriter.writeToSequence(new IIOImage(thumbnail, null,                                            thumbnailIFD),                               writeParam);    // End writing.    tiffWriter.endWriteSequence();} else {    // Write only the primary IFD.    tiffWriter.prepareWriteEmpty(streamMetadata,                                 new ImageTypeSpecifier(image),                                 image.getWidth(),                                 image.getHeight(),                                 primaryIFD,                                 null, // thumbnails                                 writeParam);    tiffWriter.endWriteEmpty();}// Flush data into byte stream.app1EXIFOutput.flush();// Create APP1 parameter array.byte[] app1Parameters = new byte[6 + baos.size()];// Add EXIF APP1 ID bytes.app1Parameters[0] = (byte)'E';app1Parameters[1] = (byte)'x';app1Parameters[2] = (byte)'i';app1Parameters[3] = (byte)'f';app1Parameters[4] = app1Parameters[5] = (byte)0;// Append TIFF stream to APP1 parameters.System.arraycopy(baos.toByteArray(), 0, app1Parameters, 6, baos.size());// Create the APP1 EXIF node to be added to native JPEG image metadata.IIOMetadataNode app1Node = new IIOMetadataNode("unknown");app1Node.setAttribute("MarkerTag", (new Integer(0xE1)).toString());app1Node.setUserObject(app1Parameters);
The "unknown" node created above would be appended to the"markerSequence" node of the native JPEG image metadataand written to the JPEG stream when the primary image is written usingthe JPEG writer.

Stream Metadata

The DTD for the stream metadata format is as follows:
<!DOCTYPE "com_sun_media_imageio_plugins_tiff_stream_1.0" [  <!ELEMENT "com_sun_media_imageio_plugins_tiff_stream_1.0" (ByteOrder)>    <!ELEMENT "ByteOrder" EMPTY>      <!-- The stream byte order -->       <!ATTLIST "ByteOrder" "value" #CDATA #REQUIRED>        <!-- One of "BIG_ENDIAN" or "LITTLE_ENDIAN" -->         <!-- Data type: String -->]>

Image Metadata

The DTD for the native image metadata format is as follows:
<!DOCTYPE "com_sun_media_imageio_plugins_tiff_image_1.0" [  <!ELEMENT "com_sun_media_imageio_plugins_tiff_image_1.0" (TIFFIFD)*>    <!ELEMENT "TIFFIFD" (TIFFField | TIFFIFD)*>      <!-- An IFD (directory) containing fields -->       <!ATTLIST "TIFFIFD" "tagSets" #CDATA #REQUIRED>        <!-- Data type: String -->      <!ATTLIST "TIFFIFD" "parentTagNumber" #CDATA #IMPLIED>        <!-- The tag number of the field pointing to this IFD -->         <!-- Data type: Integer -->      <!ATTLIST "TIFFIFD" "parentTagName" #CDATA #IMPLIED>        <!-- A mnemonic name for the field pointing to this IFD, if known              -->         <!-- Data type: String -->      <!ELEMENT "TIFFField" (TIFFBytes | TIFFAsciis |        TIFFShorts | TIFFSShorts | TIFFLongs | TIFFSLongs |        TIFFRationals | TIFFSRationals |        TIFFFloats | TIFFDoubles | TIFFUndefined)>        <!-- A field containing data -->         <!ATTLIST "TIFFField" "number" #CDATA #REQUIRED>          <!-- The tag number asociated with the field -->           <!-- Data type: String -->        <!ATTLIST "TIFFField" "name" #CDATA #IMPLIED>          <!-- A mnemonic name associated with the field, if known -->           <!-- Data type: String -->        <!ELEMENT "TIFFBytes" (TIFFByte)*>          <!-- A sequence of TIFFByte nodes -->           <!ELEMENT "TIFFByte" EMPTY>            <!-- An integral value between 0 and 255 -->             <!ATTLIST "TIFFByte" "value" #CDATA #IMPLIED>              <!-- The value -->               <!-- Data type: String -->            <!ATTLIST "TIFFByte" "description" #CDATA #IMPLIED>              <!-- A description, if available -->               <!-- Data type: String -->        <!ELEMENT "TIFFAsciis" (TIFFAscii)*>          <!-- A sequence of TIFFAscii nodes -->           <!ELEMENT "TIFFAscii" EMPTY>            <!-- A String value -->             <!ATTLIST "TIFFAscii" "value" #CDATA #IMPLIED>              <!-- The value -->               <!-- Data type: String -->        <!ELEMENT "TIFFShorts" (TIFFShort)*>          <!-- A sequence of TIFFShort nodes -->           <!ELEMENT "TIFFShort" EMPTY>            <!-- An integral value between 0 and 65535 -->             <!ATTLIST "TIFFShort" "value" #CDATA #IMPLIED>              <!-- The value -->               <!-- Data type: String -->            <!ATTLIST "TIFFShort" "description" #CDATA #IMPLIED>              <!-- A description, if available -->               <!-- Data type: String -->        <!ELEMENT "TIFFSShorts" (TIFFSShort)*>          <!-- A sequence of TIFFSShort nodes -->           <!ELEMENT "TIFFSShort" EMPTY>            <!-- An integral value between -32768 and 32767 -->             <!ATTLIST "TIFFSShort" "value" #CDATA #IMPLIED>              <!-- The value -->               <!-- Data type: String -->            <!ATTLIST "TIFFSShort" "description" #CDATA #IMPLIED>              <!-- A description, if available -->               <!-- Data type: String -->        <!ELEMENT "TIFFLongs" (TIFFLong)*>          <!-- A sequence of TIFFLong nodes -->           <!ELEMENT "TIFFLong" EMPTY>            <!-- An integral value between 0 and 4294967295 -->             <!ATTLIST "TIFFLong" "value" #CDATA #IMPLIED>              <!-- The value -->               <!-- Data type: String -->            <!ATTLIST "TIFFLong" "description" #CDATA #IMPLIED>              <!-- A description, if available -->               <!-- Data type: String -->        <!ELEMENT "TIFFSLongs" (TIFFSLong)*>          <!-- A sequence of TIFFSLong nodes -->           <!ELEMENT "TIFFSLong" EMPTY>            <!-- An integral value between -2147483648 and 2147482647 -->             <!ATTLIST "TIFFSLong" "value" #CDATA #IMPLIED>              <!-- The value -->               <!-- Data type: String -->            <!ATTLIST "TIFFSLong" "description" #CDATA #IMPLIED>              <!-- A description, if available -->               <!-- Data type: String -->        <!ELEMENT "TIFFRationals" (TIFFRational)*>          <!-- A sequence of TIFFRational nodes -->           <!ELEMENT "TIFFRational" EMPTY>            <!-- A rational value consisting of an unsigned numerator and                  denominator -->             <!ATTLIST "TIFFRational" "value" #CDATA #IMPLIED>              <!-- The numerator and denominator, separated by a slash -->               <!-- Data type: String -->        <!ELEMENT "TIFFSRationals" (TIFFSRational)*>          <!-- A sequence of TIFFSRational nodes -->           <!ELEMENT "TIFFSRational" EMPTY>            <!-- A rational value consisting of a signed numerator and                  denominator -->             <!ATTLIST "TIFFSRational" "value" #CDATA #IMPLIED>              <!-- The numerator and denominator, separated by a slash -->               <!-- Data type: String -->        <!ELEMENT "TIFFFloats" (TIFFFloat)*>          <!-- A sequence of TIFFFloat nodes -->           <!ELEMENT "TIFFFloat" EMPTY>            <!-- A single-precision floating-point value -->             <!ATTLIST "TIFFFloat" "value" #CDATA #IMPLIED>              <!-- The value -->               <!-- Data type: String -->        <!ELEMENT "TIFFDoubles" (TIFFDouble)*>          <!-- A sequence of TIFFDouble nodes -->           <!ELEMENT "TIFFDouble" EMPTY>            <!-- A double-precision floating-point value -->             <!ATTLIST "TIFFDouble" "value" #CDATA #IMPLIED>              <!-- The value -->               <!-- Data type: String -->        <!ELEMENT "TIFFUndefined" EMPTY>          <!-- Uninterpreted byte data -->           <!ATTLIST "TIFFUndefined" "value" #CDATA #IMPLIED>            <!-- A list of comma-separated byte values -->             <!-- Data type: String -->]>
Since:
1.0

Copyright © 2018 jai-imageio GitHub group. All rights reserved.



NOTHING
NOTHING
Add the Maven Dependecy to your project: maven dependecy for com.amazonaws : aws-java-sdk : 1.3.14