class_docstr: Base class for image file format handlers.
class_docstr_tok: ["Base","class","for","image","file","format","handlers","."]
code: def __init__(self, fp=None, filename=None):
      Image.Image.__init__(self)
  
      self._min_frame = 0
  
      self.custom_mimetype = None
  
      self.tile = None
      self.readonly = 1  # until we know better
  
      self.decoderconfig = ()
      self.decodermaxblock = MAXBLOCK
  
      if isPath(fp):
          # filename
          self.fp = open(fp, "rb")
          self.filename = fp
          self._exclusive_fp = True
      else:
          # stream
          self.fp = fp
          self.filename = filename
          # can be overridden
          self._exclusive_fp = None
  
      try:
          self._open()
      except (
          IndexError,  # end of data
          TypeError,  # end of data (ord)
          KeyError,  # unsupported mode
          EOFError,  # got header but not the first frame
          struct.error,
      ) as v:
          # close the file only if we have opened it this constructor
          if self._exclusive_fp:
              self.fp.close()
          raise SyntaxError(v)
  
      if not self.mode or self.size[0] <= 0:
          raise SyntaxError("not identified by this driver")
  
imports: import io
  import struct
  import sys
  from .None import Image
  from ._util import isPath
label_desc: Use image node_id 1 to create a new ImageFile object from inherited base classes: Image with example: obj = ImageFile(fp, filename)