Skip to main content

[JAI-IMAGEIO] Re: [JAI] Storing EXIF metadata in a TIFF file, 2nd question

3 replies [Last post]
Anonymous

Reply viewing options

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

This topic is really more a propos to the jai-imageio mailing list which I
have CCed. Please see my response below.

On Tue, 20 Jun 2006, Stefan Funk wrote:

> Thank you for your answer, I think I nearly did it. Modifying and storing an
> already existing IIOMetadata object just works fine now. At the moment I am
> trying to create a completely new metadata object, using the
> com.sun.media.imageio.plugins.tiff classes, but at the end the TIFFDirectory
> contains empty TIFFFields.

[...]
> --> the TIFFFields in the list are full of data (types, values, etc.)
> --> the TIFFFields of the TIFFDirectory do exist
> (tiffDir.getTIFFFields().length exactly counts all added fields)
> --> the TIFFFields of the TIFFDirectory, accessed via
> tiffDir.getTIFFField(counter) all contain null value.

Could the problem be that you are using a counter in this method

http://download.java.net/media/jai-imageio/javadoc/1.1-beta/com/sun/media/imageio/plugins/tiff/TIFFDirectory.html#getTIFFField(int)

instead of the tag number? The tag number is defined in the TIFF
specification, for example, the "PhotometricInterpretation" field has tag
number 262.

Brian

----------------
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

Stefan Funk

Hello again.

Working with TIFF EXIF metadata works fine now. I am now able to load TIFF
images with EXIF headers. The validation tool JHOVE we are using does not
recognize those images as "valid" TIFF files, because is's boundary is not
word aligned (please find an excerpt of the discussion from the JHOVE
mailinglist below).

I hoped that the methods from the library com.sun.media.imageio.plugins.tiff
would correct this issue simply by creating a new TiffField (including the
whole metadata object) and write it back as a new image.
But I have to add another char to the values that have not an even number of
chars (the END char not included), and the problem seems to exist for IFDs, too.

Shouldn't the library be able to cope with this problem and cover that issue
from the user? I am not really shure if the TIFF specs are a bit ambiguous
here. Have you some expieriences with that problem?

Thanks for your answer.
*fu*

------------------------------------------------------------------------------

"The Value is expected to begin on a word boundary; the corresponding Value
Offset will thus be an even number", p. 15, TIFF Revision 6.0, Final - June 3,
1992 .
We have interpreted this to mean that word alignment of value offsets is a
requirement, which is consistent with the TIFF IFD alignment requirement: "The
directory may be at any location in the file after the header but must begin
on a word boundary", p. 13.

--
Stefan Funk

kopal - http://kopal.langzeitarchivierung.de
Goettingen State and University Library - The Historical Library Building
Papendiek 14
37073 Goettingen, Germany
phone : +49-551-397700
mailto: funk@sub.uni-goettingen.de

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

Brian Burkhalter

Stefan,

I think you are correct. I just checked in a fix for this problem. Please try
the daily build dated 2006-09-28 or later here

https://jai-imageio.dev.java.net/binary-builds.html#Daily_builds_1.1

and let us know the results. It is important to test this soon as we are
getting near the FCS release date.

Thanks,

Brian

On Wed, 27 Sep 2006, Stefan Funk wrote:

> Hello again.
>
> Working with TIFF EXIF metadata works fine now. I am now able to load TIFF
> images with EXIF headers. The validation tool JHOVE we are using does not
> recognize those images as "valid" TIFF files, because is's boundary is not
> word aligned (please find an excerpt of the discussion from the JHOVE
> mailinglist below).
>
> I hoped that the methods from the library com.sun.media.imageio.plugins.tiff
> would correct this issue simply by creating a new TiffField (including the
> whole metadata object) and write it back as a new image.
> But I have to add another char to the values that have not an even number of
> chars (the END char not included), and the problem seems to exist for IFDs, too.
>
> Shouldn't the library be able to cope with this problem and cover that issue
> from the user? I am not really shure if the TIFF specs are a bit ambiguous
> here. Have you some expieriences with that problem?
>
> Thanks for your answer.
> *fu*
>
>
> ------------------------------------------------------------------------------
>
> "The Value is expected to begin on a word boundary; the corresponding Value
> Offset will thus be an even number", p. 15, TIFF Revision 6.0, Final - June 3,
> 1992 .
> We have interpreted this to mean that word alignment of value offsets is a
> requirement, which is consistent with the TIFF IFD alignment requirement: "The
> directory may be at any location in the file after the header but must begin
> on a word boundary", p. 13.
>
>
> --
> Stefan Funk
>
> kopal - http://kopal.langzeitarchivierung.de
> Goettingen State and University Library - The Historical Library Building
> Papendiek 14
> 37073 Goettingen, Germany
> phone : +49-551-397700
> mailto: funk@sub.uni-goettingen.de
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
> For additional commands, e-mail: interest-help@jai-imageio.dev.java.net
>
>

----------------
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