/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* @test
* @bug 6549882
* @summary Test verifies that PNG image reader creates buffered image
* of standart type for 8 bpp images with color type RGB or RGBAlpha
*
* @run main PngOutputTypeTest
*/
public class PngOutputTypeTest {
}
this(createTestImage(type));
}
this(ImageIO.createImageInputStream(f));
}
}
/*
* This test verifies that png images with color type RGB or RGBA
* are decoded as buffered image of some standard type.
*
* So we need to be sure that image provided by
* user has required color type - RGB or RGBA
*/
if (!checkImageType()) {
return;
}
throw new RuntimeException("Test FAILED!");
}
}
}
try {
} catch (IOException e) {
return false;
}
throw new RuntimeException("No ihdr node: invalid png image!");
}
// we shuld chek bitDepth
int bitDepth = -1;
try {
} catch (NumberFormatException e) {
throw new RuntimeException("Invalid bitDepth!");
}
if (bitDepth == 8) {
/*
* This image is RGB or RGBA color type and
* 8 bit tepth. so it can be used for test
*/
return true;
}
}
return false;
}
return null;
} else {
if (a == null) {
return null;
} else {
return a.getNodeValue();
}
}
}
return lookupNode(n, name);
}
if (n == null) {
return null;
}
return n;
} else {
// may be next on this level?
return res;
} else {
/// try children then
}
}
}
int w = a.getWidth();
int h = a.getHeight();
throw new RuntimeException("Test FAILED!");
}
for (int y = 0; y < h; y++) {
for (int x = 0; x < w; x++) {
throw new RuntimeException("Test FAILED!");
}
}
}
}
int w = 100;
int h = 100;
for (int y = 0; y < h; y++) {
}
}
}
}
}