Skip to main content

[JAI-IMAGEIO] reader and writer support for thumbnails

1 reply [Last post]
Anonymous

Do any of the readers and writers support thumbnails?
I tried reading an image which Photoshop claims is written with
thumbnails (windows and Macitosh preview).
I have calls to
int ct = reader.getNumThumbnails(0);
ct is 0
reader.hasThumbnails(0);
also returns false
In my own program I created a thumbnail from the image to be written out
and added it to the iioImage. Using the new file as above the reader
doesn't report any thumbnails present.
I have tried jpeg, png and tif.
I don't know if I am making the wrong calls to locate the thumbnails or
if they feally aren't available from the readers.

Steve

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Brian Burkhalter

Steve,

As far as I recall none of the baseline formats handled by Image I/O
and JAI Image I/O support thumbnails. Some format extensions do however:

JPEG JFIF: The APP0 JFIF marker segment may contain one JPEG-compressed
thumbnail and there might be one or more subsequent APP0 JFXX marker segments
each of which contains a single thumbnail which may be a JPEG-compressed,
uncompressed, or uncompressed palette-color image.

JPEG EXIF: The APP1 EXIF marker segment may contain a single JPEG-compressed
or uncompressed RGB thumbnail associated with the optional second IFD
(zero-relative index 1) in the embedded TIFF stream.

TIFF EXIF: The TIFF stream will contain one or two images with the first image
being the primary image and the second, if present, the thumbnail.

The JFIF extensions are supported completely by the Java SE JPEG plug-ins.
Please see

http://java.sun.com/j2se/1.5.0/docs/api/javax/imageio/metadata/doc-files...

for a complete description. The Java SE JPEG plug-ins do not handle the EXIF
metadata except as an "unknown" marker segment.

The JAI Image I/O Tools JPEG reader handles both the JFIF and the EXIF
thumbnails as described here

http://download.java.net/media/jai-imageio/javadoc/1.1-beta/overview-sum...

but the writer supports neither.

The JAI Image I/O Tools TIFF reader and writer support EXIF thumbnails
completely.

Brian

On Mon, 12 Jun 2006, Steve Levoe wrote:

> Do any of the readers and writers support thumbnails?
> I tried reading an image which Photoshop claims is written with thumbnails
> (windows and Macitosh preview).
> I have calls to
> int ct = reader.getNumThumbnails(0);
> ct is 0
> reader.hasThumbnails(0);
> also returns false
> In my own program I created a thumbnail from the image to be written out and
> added it to the iioImage. Using the new file as above the reader doesn't
> report any thumbnails present.
> I have tried jpeg, png and tif.
> I don't know if I am making the wrong calls to locate the thumbnails or if
> they feally aren't available from the readers.

----------------
Brian Burkhalter
Java Media, Imaging, and Graphics
Sun Microsystems, Inc.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This email message is for the sole use of the intended recipient(s)
and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net