src/share/classes/com/sun/imageio/plugins/gif/GIFImageMetadata.java

Print this page
rev 9230 : imported patch 8033716

*** 82,102 **** public int textBackgroundColor; public byte[] text; // Fields from ApplicationExtension // List of byte[] ! public List applicationIDs = null; // new ArrayList(); // List of byte[] ! public List authenticationCodes = null; // new ArrayList(); // List of byte[] ! public List applicationData = null; // new ArrayList(); // Fields from CommentExtension // List of byte[] ! public List comments = null; // new ArrayList(); protected GIFImageMetadata(boolean standardMetadataFormatSupported, String nativeMetadataFormatName, String nativeMetadataFormatClassName, String[] extraMetadataFormatNames, --- 82,102 ---- public int textBackgroundColor; public byte[] text; // Fields from ApplicationExtension // List of byte[] ! public List<byte[]> applicationIDs = null; // new ArrayList(); // List of byte[] ! public List<byte[]> authenticationCodes = null; // new ArrayList(); // List of byte[] ! public List<byte[]> applicationData = null; // new ArrayList(); // Fields from CommentExtension // List of byte[] ! public List<byte[]> comments = null; // new ArrayList(); protected GIFImageMetadata(boolean standardMetadataFormatSupported, String nativeMetadataFormatName, String nativeMetadataFormatClassName, String[] extraMetadataFormatNames,
*** 223,239 **** if (numAppExtensions > 0) { node = new IIOMetadataNode("ApplicationExtensions"); for (int i = 0; i < numAppExtensions; i++) { IIOMetadataNode appExtNode = new IIOMetadataNode("ApplicationExtension"); ! byte[] applicationID = (byte[])applicationIDs.get(i); appExtNode.setAttribute("applicationID", toISO8859(applicationID)); ! byte[] authenticationCode = (byte[])authenticationCodes.get(i); appExtNode.setAttribute("authenticationCode", toISO8859(authenticationCode)); ! byte[] appData = (byte[])applicationData.get(i); appExtNode.setUserObject(appData.clone()); node.appendChild(appExtNode); } root.appendChild(node); --- 223,239 ---- if (numAppExtensions > 0) { node = new IIOMetadataNode("ApplicationExtensions"); for (int i = 0; i < numAppExtensions; i++) { IIOMetadataNode appExtNode = new IIOMetadataNode("ApplicationExtension"); ! byte[] applicationID = applicationIDs.get(i); appExtNode.setAttribute("applicationID", toISO8859(applicationID)); ! byte[] authenticationCode = authenticationCodes.get(i); appExtNode.setAttribute("authenticationCode", toISO8859(authenticationCode)); ! byte[] appData = applicationData.get(i); appExtNode.setUserObject(appData.clone()); node.appendChild(appExtNode); } root.appendChild(node);
*** 244,254 **** if (numComments > 0) { node = new IIOMetadataNode("CommentExtensions"); for (int i = 0; i < numComments; i++) { IIOMetadataNode commentNode = new IIOMetadataNode("CommentExtension"); ! byte[] comment = (byte[])comments.get(i); commentNode.setAttribute("value", toISO8859(comment)); node.appendChild(commentNode); } root.appendChild(node); --- 244,254 ---- if (numComments > 0) { node = new IIOMetadataNode("CommentExtensions"); for (int i = 0; i < numComments; i++) { IIOMetadataNode commentNode = new IIOMetadataNode("CommentExtension"); ! byte[] comment = comments.get(i); commentNode.setAttribute("value", toISO8859(comment)); node.appendChild(commentNode); } root.appendChild(node);
*** 372,391 **** public IIOMetadataNode getStandardTextNode() { if (comments == null) { return null; } ! Iterator commentIter = comments.iterator(); if (!commentIter.hasNext()) { return null; } IIOMetadataNode text_node = new IIOMetadataNode("Text"); IIOMetadataNode node = null; // scratch node while (commentIter.hasNext()) { ! byte[] comment = (byte[])commentIter.next(); String s = null; try { s = new String(comment, "ISO-8859-1"); } catch (UnsupportedEncodingException e) { throw new RuntimeException("Encoding ISO-8859-1 unknown!"); --- 372,391 ---- public IIOMetadataNode getStandardTextNode() { if (comments == null) { return null; } ! Iterator<byte[]> commentIter = comments.iterator(); if (!commentIter.hasNext()) { return null; } IIOMetadataNode text_node = new IIOMetadataNode("Text"); IIOMetadataNode node = null; // scratch node while (commentIter.hasNext()) { ! byte[] comment = commentIter.next(); String s = null; try { s = new String(comment, "ISO-8859-1"); } catch (UnsupportedEncodingException e) { throw new RuntimeException("Encoding ISO-8859-1 unknown!");