GIF Metadata claims it is writable but throws 'read-only' exception when calling setFromTree()

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P2
    • 6
    • Affects Version/s: 6
    • Component/s: client-libs
    • b47
    • generic
    • generic
    • Verified

      I am getting the IIOMetadataNode from GIF Image Metadata by calling IIOMetadata.getAsTree() and checking whether metadata is read only. IIOMetadata.isReadOnly() returns false. So I am calling IIOMetadata.setFromTree() by passing the same node what I obtained from the metadata for the same format. But I am getting an IllegalStateException saying metadata is read only. This is incorrect. If metadata.isReadOnly() returns false, it must allow setFromTree() and merge operations.

      This is reproducible on all platforms only for the GIF format. Works fine for other formats. This is reproducible with standard as well as native metadata format.

      I have attached a sample test. Execute the sample test as follows:
      'java WriterImageMetadataTest gif merge'
      You would see the following exception on the console:

      java.lang.IllegalStateException: Metadata is read-only!
      at com.sun.imageio.plugins.gif.GIFImageMetadata.setFromTree(GIFImageMetadata.java:413)
      at WriterImageMetadataTest.<init>(WriterImageMetadataTest.java:70)
      at WriterImageMetadataTest.main(WriterImageMetadataTest.java:128)

      ###@###.### 2005-06-20 10:47:41 GMT

            Assignee:
            Andrew Brygin
            Reporter:
            Praveen Mohan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: