code: def _chunk_len_type(self):
          
  
          x = self.file.read(8)
          if not x:
              return None
          if len(x) != 8:
              raise FormatError(
                  'End of file whilst reading chunk length and type.')
          length, type = struct.unpack('!I4s', x)
          if length > 2 ** 31 - 1:
              raise FormatError('Chunk %s is too large: %d.' % (type, length))
          # Check that all bytes are in valid ASCII range.
          # https://www.w3.org/TR/2003/REC-PNG-20031110/#5Chunk-layout
          type_bytes = set(bytearray(type))
          if not(type_bytes <= set(range(65, 91)) | set(range(97, 123))):
              raise FormatError(
                  'Chunk %r has invalid Chunk Type.'
                  % list(type))
          return length, type
docs: Reads just enough of the input to
          determine the next chunk's length and type;
          return a (*length*, *type*) pair where *type* is a byte sequence.
          If there are no more chunks, ``None`` is returned.