@Test public void testGetQTables() throws IOException { ImageInputStream stream = ImageIO.createImageInputStream(getClass().getResourceAsStream("/jpeg/9788245605525.jpg")); try { JPEGQTable[] tables = JPEGQuality.getQTables(JPEGSegmentUtil.readSegments(stream, JPEG.DQT, null)); assertEquals(1, tables.length); int[] table = { 3, 2, 2, 2, 2, 2, 3, 2, 2, 2, 3, 3, 3, 3, 4, 6, 4, 4, 4, 4, 4, 8, 6, 6, 5, 6, 9, 8, 10, 10, 9, 8, 9, 9, 10, 12, 15, 12, 10, 11, 14, 11, 9, 9, 13, 17, 13, 14, 15, 16, 16, 17, 16, 10, 12, 18, 19, 18, 16, 19, 15, 16, 16, 16 }; assertArrayEquals(table, tables[0].getTable()); // JPEGQTable has no useful equals method.. // assertArrayEquals(new JPEGQTable[] {new JPEGQTable(table)}, tables); } finally { stream.close(); } }
(byte)(((qt.elementPrecision & 0xf0) << 4) | (qt.tableID & 0x0f)); int[] table = qt.table.getTable(); int qlen = table.length; for(int i = 0; i < qlen; i++) {
@Test public void testGetQTables() throws IOException { ImageInputStream stream = ImageIO.createImageInputStream(getClass().getResourceAsStream("/jpeg/9788245605525.jpg")); try { JPEGQTable[] tables = JPEGQuality.getQTables(JPEGSegmentUtil.readSegments(stream, JPEG.DQT, null)); assertEquals(1, tables.length); int[] table = { 3, 2, 2, 2, 2, 2, 3, 2, 2, 2, 3, 3, 3, 3, 4, 6, 4, 4, 4, 4, 4, 8, 6, 6, 5, 6, 9, 8, 10, 10, 9, 8, 9, 9, 10, 12, 15, 12, 10, 11, 14, 11, 9, 9, 13, 17, 13, 14, 15, 16, 16, 17, 16, 10, 12, 18, 19, 18, 16, 19, 15, 16, 16, 16 }; assertArrayEquals(table, tables[0].getTable()); // JPEGQTable has no useful equals method.. // assertArrayEquals(new JPEGQTable[] {new JPEGQTable(table)}, tables); } finally { stream.close(); } }
42, 38, 50, 53, 50, 66, 66, 86, }, tables[0].getTable() ); assertArrayEquals(
3, 3, 3, 3, 3, 3, 3, 3, }, tables[0].getTable() ); assertArrayEquals(