Info
in
Provide information and features supported by a graphics driver.
Tags
Table of Contents
Constants
- FEATURE_ADDLAYERSTOEMPTYIMAGE = 20
- Adding frames to a image with no previously loaded layers works.
- FEATURE_COALESCELAYERS = 4
- Affected functions: Imagine\Image\LayersInterface::coalesce().
- FEATURE_COLORIZEIMAGE = 6
- Affected functions: Imagine\Effects\EffectsInterface::colorize().
- FEATURE_COLORPROFILES = 1
- Affected functions: Imagine\Image\ImageInterface::profile(), Imagine\Image\ImageInterface::usePalette().
- FEATURE_COLORSPACECONVERSION = 2
- Affected functions: Imagine\Image\ImageInterface::usePalette(), opening images with particular colorspaces.
- FEATURE_CONVOLVEIMAGE = 8
- Affected functions: Imagine\Effects\EffectsInterface::convolve().
- FEATURE_CUSTOMRESOLUTION = 11
- Affected functions: none at the moment.
- FEATURE_DETECTGRAYCOLORSPACE = 21
- Affected functions: Imagine\Image\ImagineInterface::open(), Imagine\Image\ImagineInterface::load(), Imagine\Image\ImagineInterface::read().
- FEATURE_DRAWFILLEDCHORDSCORRECTLY = 13
- Affected functions: Imagine\Draw\DrawerInterface::chord() with $fill == true.
- FEATURE_DRAWUNFILLEDCIRCLESWITHTICHKESSCORRECTLY = 14
- Affected functions: Imagine\Draw\DrawerInterface::circle() with $fill == false and $thickness > 1.
- FEATURE_DRAWUNFILLEDELLIPSESWITHTICHKESSCORRECTLY = 15
- Affected functions: Imagine\Draw\DrawerInterface::ellipse() with $fill == false and $thickness > 1.
- FEATURE_EXPORTWITHCUSTOMJPEGSAMPLINGFACTORS = 19
- Affected functions: Imagine\Image\ImageInterface::get(), Imagine\Image\ImageInterface::save(), Imagine\Image\ImageInterface::show().
- FEATURE_EXPORTWITHCUSTOMRESOLUTION = 12
- Affected functions: Imagine\Image\ImageInterface::get(), Imagine\Image\ImageInterface::save(), Imagine\Image\ImageInterface::show().
- FEATURE_GETCMYKCOLORSCORRECTLY = 16
- Affected functions: Imagine\Image\ImageInterface::getColorAt() when the palette is CMYK.
- FEATURE_GRAYSCALEEFFECT = 3
- Affected functions: Imagine\Effects\EffectsInterface::grayscale().
- FEATURE_MULTIPLELAYERS = 10
- Affected functions: Imagine\Image\LayersInterface methods that would create more that 1 layer or 0 layers.
- FEATURE_NEGATEIMAGE = 5
- Affected functions: Imagine\Effects\EffectsInterface::negative().
- FEATURE_ROTATEIMAGEWITHCORRECTSIZE = 18
- Affected functions: Imagine\Image\ImageInterface::rotate(), Imagine\Filter\Basic\Rotate.
- FEATURE_SHARPENIMAGE = 7
- Affected functions: Imagine\Effects\EffectsInterface::sharpen().
- FEATURE_TEXTFUNCTIONS = 9
- Affected functions: Imagine\Draw\DrawerInterface::text() and Imagine\Image\FontInterface::box().
- FEATURE_TRANSPARENCY = 17
- Affected functions: any that uses colors with an alpha channel.
Methods
- checkVersionIsSupported() : mixed
- Check if the current driver/engine version combination is supported.
- get() : static|null
- Get the Info instance for a specific driver.
- getDriverVersion() : mixed
- Get the version of the driver.
- getEngineVersion() : mixed
- Get the version of the library used by the driver.
- getSupportedFormats() : FormatList
- Get the list of supported file formats.
- hasFeature() : bool
- Check if the driver the features requested.
- isFormatSupported() : bool
- Check if a format is supported.
- isPaletteSupported() : bool
- Check if a palette is supported.
- requireFeature() : mixed
- Check if the driver has the features requested.
- requirePaletteSupport() : mixed
- Check if a palette is supported.
Constants
FEATURE_ADDLAYERSTOEMPTYIMAGE
Adding frames to a image with no previously loaded layers works.
public
int
FEATURE_ADDLAYERSTOEMPTYIMAGE
= 20
FEATURE_COALESCELAYERS
Affected functions: Imagine\Image\LayersInterface::coalesce().
public
int
FEATURE_COALESCELAYERS
= 4
See also the FEATURE_MULTIPLELAYERS feature
FEATURE_COLORIZEIMAGE
Affected functions: Imagine\Effects\EffectsInterface::colorize().
public
int
FEATURE_COLORIZEIMAGE
= 6
FEATURE_COLORPROFILES
Affected functions: Imagine\Image\ImageInterface::profile(), Imagine\Image\ImageInterface::usePalette().
public
int
FEATURE_COLORPROFILES
= 1
FEATURE_COLORSPACECONVERSION
Affected functions: Imagine\Image\ImageInterface::usePalette(), opening images with particular colorspaces.
public
int
FEATURE_COLORSPACECONVERSION
= 2
See also the requirePaletteSupport/isPaletteSupported driver info methods.
FEATURE_CONVOLVEIMAGE
Affected functions: Imagine\Effects\EffectsInterface::convolve().
public
int
FEATURE_CONVOLVEIMAGE
= 8
FEATURE_CUSTOMRESOLUTION
Affected functions: none at the moment.
public
int
FEATURE_CUSTOMRESOLUTION
= 11
FEATURE_DETECTGRAYCOLORSPACE
Affected functions: Imagine\Image\ImagineInterface::open(), Imagine\Image\ImagineInterface::load(), Imagine\Image\ImagineInterface::read().
public
int
FEATURE_DETECTGRAYCOLORSPACE
= 21
FEATURE_DRAWFILLEDCHORDSCORRECTLY
Affected functions: Imagine\Draw\DrawerInterface::chord() with $fill == true.
public
int
FEATURE_DRAWFILLEDCHORDSCORRECTLY
= 13
FEATURE_DRAWUNFILLEDCIRCLESWITHTICHKESSCORRECTLY
Affected functions: Imagine\Draw\DrawerInterface::circle() with $fill == false and $thickness > 1.
public
int
FEATURE_DRAWUNFILLEDCIRCLESWITHTICHKESSCORRECTLY
= 14
FEATURE_DRAWUNFILLEDELLIPSESWITHTICHKESSCORRECTLY
Affected functions: Imagine\Draw\DrawerInterface::ellipse() with $fill == false and $thickness > 1.
public
int
FEATURE_DRAWUNFILLEDELLIPSESWITHTICHKESSCORRECTLY
= 15
FEATURE_EXPORTWITHCUSTOMJPEGSAMPLINGFACTORS
Affected functions: Imagine\Image\ImageInterface::get(), Imagine\Image\ImageInterface::save(), Imagine\Image\ImageInterface::show().
public
int
FEATURE_EXPORTWITHCUSTOMJPEGSAMPLINGFACTORS
= 19
FEATURE_EXPORTWITHCUSTOMRESOLUTION
Affected functions: Imagine\Image\ImageInterface::get(), Imagine\Image\ImageInterface::save(), Imagine\Image\ImageInterface::show().
public
int
FEATURE_EXPORTWITHCUSTOMRESOLUTION
= 12
FEATURE_GETCMYKCOLORSCORRECTLY
Affected functions: Imagine\Image\ImageInterface::getColorAt() when the palette is CMYK.
public
int
FEATURE_GETCMYKCOLORSCORRECTLY
= 16
FEATURE_GRAYSCALEEFFECT
Affected functions: Imagine\Effects\EffectsInterface::grayscale().
public
int
FEATURE_GRAYSCALEEFFECT
= 3
FEATURE_MULTIPLELAYERS
Affected functions: Imagine\Image\LayersInterface methods that would create more that 1 layer or 0 layers.
public
int
FEATURE_MULTIPLELAYERS
= 10
FEATURE_NEGATEIMAGE
Affected functions: Imagine\Effects\EffectsInterface::negative().
public
int
FEATURE_NEGATEIMAGE
= 5
FEATURE_ROTATEIMAGEWITHCORRECTSIZE
Affected functions: Imagine\Image\ImageInterface::rotate(), Imagine\Filter\Basic\Rotate.
public
int
FEATURE_ROTATEIMAGEWITHCORRECTSIZE
= 18
FEATURE_SHARPENIMAGE
Affected functions: Imagine\Effects\EffectsInterface::sharpen().
public
int
FEATURE_SHARPENIMAGE
= 7
FEATURE_TEXTFUNCTIONS
Affected functions: Imagine\Draw\DrawerInterface::text() and Imagine\Image\FontInterface::box().
public
int
FEATURE_TEXTFUNCTIONS
= 9
FEATURE_TRANSPARENCY
Affected functions: any that uses colors with an alpha channel.
public
int
FEATURE_TRANSPARENCY
= 17
Methods
checkVersionIsSupported()
Check if the current driver/engine version combination is supported.
public
checkVersionIsSupported() : mixed
Tags
get()
Get the Info instance for a specific driver.
public
static get([bool $required = true ]) : static|null
Parameters
- $required : bool = true
-
when the driver is not available: if FALSE the function returns NULL, if TRUE the driver throws a \Imagine\Exception\NotSupportedException
Tags
Return values
static|null —return NULL if the driver is not available and $required is FALSE
getDriverVersion()
Get the version of the driver.
public
getDriverVersion([bool $raw = false ]) : mixed
For example:
- for GD: it's the version of PHP
- for gmagick: it's the version of the gmagick PHP extension
- for imagick: it's the version of the imagick PHP extension.
Parameters
- $raw : bool = false
-
if false the result will be in the format
. . , if TRUE the result will be the raw version
getEngineVersion()
Get the version of the library used by the driver.
public
getEngineVersion([bool $raw = false ]) : mixed
For example:
- for GD: it's the version of libgd
- for gmagick: it's the version of the GraphicsMagick
- for imagick: it's the version of the ImageMagick.
Parameters
- $raw : bool = false
-
if false the result will be in the format
. . , if TRUE the result will be the raw version
getSupportedFormats()
Get the list of supported file formats.
public
getSupportedFormats() : FormatList
Return values
FormatListhasFeature()
Check if the driver the features requested.
public
hasFeature(int|array<string|int, int> $features) : bool
Parameters
- $features : int|array<string|int, int>
-
The features to be checked (see the Info::FEATURE_... constants)
Return values
bool —returns TRUE if the driver supports all the specified features, FALSE otherwise
isFormatSupported()
Check if a format is supported.
public
isFormatSupported(Format|string $format) : bool
Parameters
- $format : Format|string
Return values
boolisPaletteSupported()
Check if a palette is supported.
public
isPaletteSupported(PaletteInterface $palette) : bool
Parameters
- $palette : PaletteInterface
Return values
boolrequireFeature()
Check if the driver has the features requested.
public
requireFeature(int|array<string|int, int> $features) : mixed
Parameters
- $features : int|array<string|int, int>
-
The features to be checked (see the Info::FEATURE_... constants)
Tags
requirePaletteSupport()
Check if a palette is supported.
public
requirePaletteSupport(PaletteInterface $palette) : mixed
Parameters
- $palette : PaletteInterface