### Constructor

# Vips Source new_from_file

#### Declaration [src]

    VipsSource*
    vips_source_new_from_file (
      const char* filename
    )

#### Description [src]

Create a source attached to a file.

If this descriptor does not support mmap and the source is used with a loader that can only work from memory, then the data will be automatically read into memory to EOF before the loader starts. This can produce high memory use if the descriptor represents a large object.

Use `vips_pipe_read_limit_set()` to limit the size of object that will be read in this way. The default is 1GB.

#### Parameters

`filename`

  Type: `const char*`

  Read from this filename.

  The data is owned by the caller of the function.
  The value is a NUL terminated UTF-8 string.

#### Return value

Type: `VipsSource`

A new source.

The caller of the function takes ownership of the data, and is responsible for freeing it.