throw new ImageException(msg);
}
// only some chunks are worth parsing in the current implementation
do {
try {
PNGChunk chunk;
String chunkType = PNGChunk.getChunkType(distream);
if (chunkType.equals(PNGChunk.ChunkType.IHDR.name())) {
chunk = PNGChunk.readChunk(distream);
parse_IHDR_chunk(chunk);
} else if (chunkType.equals(PNGChunk.ChunkType.PLTE.name())) {
chunk = PNGChunk.readChunk(distream);
parse_PLTE_chunk(chunk);
} else if (chunkType.equals(PNGChunk.ChunkType.IDAT.name())) {
chunk = PNGChunk.readChunk(distream);
streamVec.add(new ByteArrayInputStream(chunk.getData()));
} else if (chunkType.equals(PNGChunk.ChunkType.IEND.name())) {
// chunk = PNGChunk.readChunk(distream);
PNGChunk.skipChunk(distream);
break; // fall through to the bottom
} else if (chunkType.equals(PNGChunk.ChunkType.tRNS.name())) {