def profileFromPNG(inp):
    """
    Extract profile from PNG file.  Return (*profile*, *name*)
    pair.
    """
    r = png.Reader(file=inp)
    _, chunk = r.chunk('iCCP')
    i = chunk.index(b'\x00')
    name = chunk[: i]
    compression = chunk[i + 1]
    assert compression == 0
    profile = zlib.decompress(chunk[i + 2:])
    return profile, name
Extract profile from PNG file.  Return (*profile*, *name*)
    pair.