# HG changeset patch # User pnarayanan # Date 1521699075 -19800 # Node ID fe898e8bd2712c15e48728d6f85a0bbeaa1c4b6a # Parent 2f2b37908f9189dcd9414d7949a5e15c8fd34311 6686236: GIF native IIOMetadata assumes characterCellWidth/Height as 2bytes Reviewed-by: prr, jdv diff -r 2f2b37908f91 -r fe898e8bd271 src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFImageMetadataFormat.java --- a/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFImageMetadataFormat.java Wed Mar 21 12:08:16 2018 +0530 +++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFImageMetadataFormat.java Thu Mar 22 11:41:15 2018 +0530 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -119,10 +119,10 @@ "1", "65535", true, true); addAttribute("PlainTextExtension", "characterCellWidth", DATATYPE_INTEGER, true, null, - "1", "65535", true, true); + "1", "255", true, true); addAttribute("PlainTextExtension", "characterCellHeight", DATATYPE_INTEGER, true, null, - "1", "65535", true, true); + "1", "255", true, true); addAttribute("PlainTextExtension", "textForegroundColor", DATATYPE_INTEGER, true, null, "0", "255", true, true); diff -r 2f2b37908f91 -r fe898e8bd271 src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFWritableImageMetadata.java --- a/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFWritableImageMetadata.java Wed Mar 21 12:08:16 2018 +0530 +++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFWritableImageMetadata.java Thu Mar 22 11:41:15 2018 +0530 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -203,15 +203,18 @@ -1, true, true, 1, 65535); + // As per the specification (89a), character cell width + // and character cell height occupy one byte each + // in the Plain Text Extension block. characterCellWidth = getIntAttribute(node, "characterCellWidth", -1, true, - true, 1, 65535); + true, 1, 255); characterCellHeight = getIntAttribute(node, "characterCellHeight", -1, true, - true, 1, 65535); + true, 1, 255); textForegroundColor = getIntAttribute(node, "textForegroundColor", diff -r 2f2b37908f91 -r fe898e8bd271 src/java.desktop/share/classes/javax/imageio/metadata/doc-files/gif_metadata.html --- a/src/java.desktop/share/classes/javax/imageio/metadata/doc-files/gif_metadata.html Wed Mar 21 12:08:16 2018 +0530 +++ b/src/java.desktop/share/classes/javax/imageio/metadata/doc-files/gif_metadata.html Thu Mar 22 11:41:15 2018 +0530 @@ -5,7 +5,7 @@ GIF Metadata Format Specification