11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /**
25 * @test
26 * @bug 6198111
27 * @summary Test verifies that PNG image reader correctly handles
28 * hIST chunk if length of image palette in not power of two.
29 *
30 * @run main ShortHistogramTest 15
31 */
32
33 import java.awt.Color;
34 import java.awt.Graphics2D;
35 import java.awt.image.BufferedImage;
36 import java.awt.image.DataBuffer;
37 import java.awt.image.IndexColorModel;
38 import java.awt.image.Raster;
39 import java.io.File;
40 import java.io.IOException;
41 import java.util.Arrays;
42 import java.util.Random;
43 import javax.imageio.IIOImage;
44 import javax.imageio.ImageIO;
45 import javax.imageio.ImageTypeSpecifier;
46 import javax.imageio.ImageWriteParam;
47 import javax.imageio.ImageWriter;
48 import javax.imageio.metadata.IIOInvalidTreeException;
49 import javax.imageio.metadata.IIOMetadata;
50 import javax.imageio.metadata.IIOMetadataNode;
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /**
25 * @test
26 * @bug 6198111
27 * @summary Test verifies that PNG image reader correctly handles
28 * hIST chunk if length of image palette in not power of two.
29 *
30 * @run main ShortHistogramTest 15
31 * @key randomness
32 */
33
34 import java.awt.Color;
35 import java.awt.Graphics2D;
36 import java.awt.image.BufferedImage;
37 import java.awt.image.DataBuffer;
38 import java.awt.image.IndexColorModel;
39 import java.awt.image.Raster;
40 import java.io.File;
41 import java.io.IOException;
42 import java.util.Arrays;
43 import java.util.Random;
44 import javax.imageio.IIOImage;
45 import javax.imageio.ImageIO;
46 import javax.imageio.ImageTypeSpecifier;
47 import javax.imageio.ImageWriteParam;
48 import javax.imageio.ImageWriter;
49 import javax.imageio.metadata.IIOInvalidTreeException;
50 import javax.imageio.metadata.IIOMetadata;
51 import javax.imageio.metadata.IIOMetadataNode;
|