public boolean dumpImageFile(PrintWriter pw, ByteSource byteSource)
            throws ImageReadException, IOException
    {
        ImageInfo imageInfo = getImageInfo(byteSource);
        if (imageInfo == null)
            return false;

        imageInfo.toString(pw, "");

        {
            ArrayList chunks = readChunks(byteSource, null, false);
            {
                ArrayList IHDRs = filterChunks(chunks, IHDR);
                if (IHDRs.size() != 1)
                {
                    if (debug)
                        System.out.println("PNG contains more than one Header");
                    return false;
                }
                PNGChunkIHDR pngChunkIHDR = (PNGChunkIHDR) IHDRs.get(0);
                pw.println("Color: "
                        + getColorTypeDescription(pngChunkIHDR.colorType));
            }

            pw.println("chunks: " + chunks.size());

            if ((chunks.size() < 1))
                return false;

            for (int i = 0; i < chunks.size(); i++)
            {
                PNGChunk chunk = (PNGChunk) chunks.get(i);
                printCharQuad(pw, "\t" + i + ": ", chunk.chunkType);
            }
        }

        pw.println("");

        pw.flush();

        return true;
    }