class_docstr: An input connection.
  
      
docstr: Make a new source from a filename.
  
  Make a new source that is attached to the named file. For example::
  
      source = pyvips.Source.new_from_file("myfile.jpg")
  
  You can pass this source to (for example) :meth:`new_from_source`.
docstr_tok: ["Make","a","new","source","from","a","filename",".","Make","a","new","source","that","is","attached","to","the","named","file",".","For","example",":",":","source","=","pyvips.Source.new_from_file","(","``","myfile.jpg","''",")","You","can","pass","this","source","to","(","for","example",")",":","meth",":","`","new_from_source","`","."]
code: def new_from_file(filename):
      """Make a new source from a filename.
  
      Make a new source that is attached to the named file. For example::
  
          source = pyvips.Source.new_from_file("myfile.jpg")
  
      You can pass this source to (for example) :meth:`new_from_source`.
  
      """
  
      # logger.debug('VipsSource.new_from_file: filename = %s',
      #              filename)
  
      pointer = vips_lib.vips_source_new_from_file(_to_bytes(filename))
      if pointer == ffi.NULL:
          raise Error(
              "can't create source from filename {0}".format(filename)
          )
  
      return Source(pointer)
  
file_path: pyvips/pyvips/vsource.py
imports: from __future__ import division
  import logging
  import pyvips
  from pyvips import ffi, vips_lib, Error, _to_bytes
label_desc: Use image node_id 3 for calling the Source obj's underlying member method code with example usage: obj.new_from_file(filename) and returns: Source