PHP Class Webiny\Component\Image\Bridge\Imagine\Imagine

Inheritance: implements Webiny\Component\Image\Bridge\ImageLoaderInterface, use trait Webiny\Component\StdLib\StdLibTrait
Mostrar archivo Open project: Webiny/Framework

Public Methods

Method Description
__construct ( ConfigObject $config ) Base constructor.
create ( integer $width, integer $height, string $bgColor = null, integer $alpha = 100 ) : Webiny\Component\Image\ImageInterface Create a blank image with of given dimensions and fill it with $bgColor.
load ( string $string ) : Webiny\Component\Image\ImageInterface Create a new ImageInterface instance form the given binary string.
open ( File $image ) : Webiny\Component\Image\ImageInterface Creates a new ImageInterface instance from the given image at the provided path.
resource ( mixed $resource ) : Webiny\Component\Image\ImageInterface Create a new ImageInterface instance from the given resource.

Private Methods

Method Description
getLibraryInstance ( string $library ) : Imagine\Gd\Imagine | Imagine\Gmagick\Imagine | Imagine\Imagick\Imagine Create a library instance based on given library name.

Method Details

__construct() public method

Base constructor.
public __construct ( ConfigObject $config )
$config Webiny\Component\Config\ConfigObject

create() public method

Create a blank image with of given dimensions and fill it with $bgColor.
public create ( integer $width, integer $height, string $bgColor = null, integer $alpha = 100 ) : Webiny\Component\Image\ImageInterface
$width integer Width of the new image.
$height integer Height of the new image.
$bgColor string Background color. Following formats are acceptable - "fff" - "ffffff" - array(255,255,255)
$alpha integer Alpha transparency.
return Webiny\Component\Image\ImageInterface

load() public method

Create a new ImageInterface instance form the given binary string.
public load ( string $string ) : Webiny\Component\Image\ImageInterface
$string string Binary string that holds image information.
return Webiny\Component\Image\ImageInterface

open() public method

Creates a new ImageInterface instance from the given image at the provided path.
public open ( File $image ) : Webiny\Component\Image\ImageInterface
$image Webiny\Component\Storage\File\File Path to an image on the disk.
return Webiny\Component\Image\ImageInterface

resource() public method

Create a new ImageInterface instance from the given resource.
public resource ( mixed $resource ) : Webiny\Component\Image\ImageInterface
$resource mixed Resource.
return Webiny\Component\Image\ImageInterface