def __init__(self, fobj):
        # signature : (start, length)
        self.dct = dct = {}
        self.fobj = fobj
        sig, filesize = nextheader(fobj)
        if sig != 'icns':
            raise SyntaxError, 'not an icns file'
        i = HEADERSIZE
        while i < filesize:
            sig, blocksize = nextheader(fobj)
            i = i + HEADERSIZE
            blocksize = blocksize - HEADERSIZE
            dct[sig] = (i, blocksize)
            fobj.seek(blocksize, 1)
            i = i + blocksize
fobj is a file-like object as an icns resource
dataset/ETHPy150Open kleientertainment/ds_mod_tools/pkg/win32/Python27/Lib/site-packages/PIL/IcnsImagePlugin.py/IcnsFile.__init__