docstr: fobj is a file-like object as an icns resource
docstr_tok: ["fobj","is","a","file-like","object","as","an","icns","resource"]
code: def __init__(self, fobj):
      """
      fobj is a file-like object as an icns resource
      """
      # signature : (start, length)
      self.dct = dct = {}
      self.fobj = fobj
      sig, filesize = nextheader(fobj)
      if sig != b"icns":
          raise SyntaxError("not an icns file")
      i = HEADERSIZE
      while i < filesize:
          sig, blocksize = nextheader(fobj)
          if blocksize <= 0:
              raise SyntaxError("invalid block header")
          i += HEADERSIZE
          blocksize -= HEADERSIZE
          dct[sig] = (i, blocksize)
          fobj.seek(blocksize, io.SEEK_CUR)
          i += blocksize
  
imports: import io
  import os
  import shutil
  import struct
  import sys
  import tempfile
  from PIL import Image, ImageFile, PngImagePlugin
  from PIL._binary import i8
label_desc: Use image node_id 1 to create a new IcnsFile object from inherited base classes: object with example: obj = IcnsFile(fobj)