# HaruDoc::loadPNG

(PECL haru >= 0.0.1)

HaruDoc::loadPNG — Load PNG image and return HaruImage instance

### Description

HaruDoc::loadPNG ( string `$filename` [, bool `$deferred` = `FALSE` ] ) : object

Loads a PNG image.

Libharu might be built without libpng support, in this case each call to this function would result in exception.

### Parameters

`filename`

  The name of a PNG image file.

`deferred`

  Do not load data immediately. You can set `deferred` parameter to `TRUE` for deferred data loading, in this case only size and color are loaded immediately.

### Return Values

Returns a HaruImage instance.

### Errors/Exceptions

Throws a HaruException on error.

### See Also

- HaruDoc::loadJPEG() - Load a JPEG image
- HaruDoc::loadRAW() - Load a RAW image