ImageLoader
in package
Table of Contents
- $preferredAdapter : AdapterInterface|string|null
- createAdapter() : AdapterInterface
- Creates an adapter instance according to config settings.
- isBinary() : bool
- Determines if given source data is binary data.
- isFilePath() : bool
- Determines if given source data is file path.
- isGdImage() : bool
- Determines if given source data is a GD image.
- isGmagick() : bool
- Determines if given source data is a Gmagick object.
- isImagick() : bool
- Determines if given source data is an Imagick object.
- isUrl() : bool
- Determines if given source data is url.
- load() : AdapterInterface
- setPreferredAdapter() : self
- Configure the preferred adapter to use to load images.
Properties
$preferredAdapter
private
AdapterInterface|string|null
$preferredAdapter
= null
Methods
createAdapter()
Creates an adapter instance according to config settings.
public
createAdapter([string|AdapterInterface|null $preferredAdapter = null ]) : AdapterInterface
Parameters
- $preferredAdapter : string|AdapterInterface|null = null
Return values
AdapterInterface —isBinary()
Determines if given source data is binary data.
public
isBinary(mixed $data) : bool
Parameters
- $data : mixed
Return values
bool —isFilePath()
Determines if given source data is file path.
public
isFilePath(mixed $data) : bool
Parameters
- $data : mixed
Return values
bool —isGdImage()
Determines if given source data is a GD image.
public
isGdImage(mixed $data) : bool
Parameters
- $data : mixed
Return values
bool —isGmagick()
Determines if given source data is a Gmagick object.
public
isGmagick(mixed $data) : bool
Parameters
- $data : mixed
Return values
bool —isImagick()
Determines if given source data is an Imagick object.
public
isImagick(mixed $data) : bool
Parameters
- $data : mixed
Return values
bool —isUrl()
Determines if given source data is url.
public
isUrl(mixed $data) : bool
Parameters
- $data : mixed
Return values
bool —load()
public
load(mixed $source) : AdapterInterface
Parameters
- $source : mixed
-
Path/URL to the image, GD resource, Imagick/Gmagick instance, or image as binary string
Return values
AdapterInterface —setPreferredAdapter()
Configure the preferred adapter to use to load images.
public
setPreferredAdapter(string|AdapterInterface|null $adapter) : self
Parameters
- $adapter : string|AdapterInterface|null
-
Name of the preferred adapter or adapter instance. If null, the adapter is automatically chosen according to the available extensions.