[OpenJDK 2D-Dev] 5082756: Image I/O plug-ins set metadata boolean attributes to "true" or "false"

Martin von Gagern Martin.vGagern at gmx.net
Wed Nov 12 18:29:32 UTC 2008

Hello Andrew,

Andrew Brygin wrote:
> fix looks fine for me in general, just one minor note:

Thanks for looking at this. Let me know when you think it ready for

> There is getBooleanAttribute() method in the GIFMetadata class, which
> probably should be modified as a part of this fix. This method  uses
> equalsIgnoreCase() to compare attribute values and refers this bug
> as a reason for this "too tolerant" approach. It also seems to be
> inconsistent
> with suggested implementation of similar method in the PNGMetadata class.

I had mentioned that issue with GIFMetadata in my mail, yes.
I now made GIFMetadata behave like PNGMetadata, i.e. only allow strictly
upper or strictly lower case, no mixed forms.

> Could you also provide a regression test for this change?

I wrote a test case. For the formats PNG, JPEG and GIF it merges a
native tree containing uppercase versions of every possible boolean
value. It then verifies that in the tree generated by asTree the values
are still uppercase. The verification is repeated again after the images
got written to a stream and were read back. Standard trees are verified
as well, though not merged with.

The text class divides roughly into two parts. One listing the test
cases, consisting of MIME type, Metadata XML and XPath expressions of
the values to be checked, the other performs the specified tests. The
framework seems pretty flexible and might well be used for other
metadata-related tests as well. Do you agree with the imageio/metadata
directory, as it affects multiple plugins and duplicating the code seems
a bad idea?

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: bug5082756.patch
URL: <http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20081112/8a3826c4/bug5082756.patch>

More information about the 2d-dev mailing list