Property | Type | Description | |
---|---|---|---|
$driver | the driver to use. This can be either a single driver name or an array of driver names. If the latter, the first available driver will be used. | ||
$thumbnailBackgroundAlpha | background alpha (transparency) to use when creating thumbnails in ImageInterface::THUMBNAIL_INSET mode with both width and height specified. Default is solid. | ||
$thumbnailBackgroundColor | background color to use when creating thumbnails in ImageInterface::THUMBNAIL_INSET mode with both width and height specified. Default is white. |
Method | Description | |
---|---|---|
autorotate ( string | resource | Imagine\Image\ImageInterface $image, string $color = '000000' ) : Imagine\Image\ImageInterface | Rotates an image automatically based on EXIF information. | |
crop ( string | resource | Imagine\Image\ImageInterface $image, integer $width, integer $height, array $start = [0, 0] ) : Imagine\Image\ImageInterface | Crops an image. | |
frame ( string | resource | Imagine\Image\ImageInterface $image, integer $margin = 20, string $color = '666', integer $alpha = 100 ) : Imagine\Image\ImageInterface | Adds a frame around of the image. Please note that the image size will increase by $margin x 2. | |
getImagine ( ) : Imagine\Image\ImagineInterface | Returns the Imagine object that supports various image manipulations. | |
resize ( string | resource | Imagine\Image\ImageInterface $image, integer $width, integer $height, boolean $keepAspectRatio = true, boolean $allowUpscaling = false ) : Imagine\Image\ImageInterface | Resizes an image. | |
setImagine ( Imagine\Image\ImagineInterface $imagine ) | ||
text ( string | resource | Imagine\Image\ImageInterface $image, string $text, string $fontFile, array $start = [0, 0], array $fontOptions = [] ) : Imagine\Image\ImageInterface | Draws a text string on an existing image. | |
thumbnail ( string | resource | Imagine\Image\ImageInterface $image, integer $width, integer $height, string $mode = ManipulatorInterface::THUMBNAIL_OUTBOUND ) : Imagine\Image\ImageInterface | Creates a thumbnail image. | |
watermark ( string | resource | Imagine\Image\ImageInterface $image, string | resource | Imagine\Image\ImageInterface $watermarkImage, array $start = [0, 0] ) : Imagine\Image\ImageInterface | Adds a watermark to an existing image. |
Method | Description | |
---|---|---|
createImagine ( ) : Imagine\Image\ImagineInterface | Creates an Imagine object based on the specified [[driver]]. | |
ensureImageInterfaceInstance ( string | resource | Imagine\Image\ImageInterface $image ) : Imagine\Image\ImageInterface | Takes either file path or ImageInterface. In case of file path, creates an instance of ImageInterface from it. | |
getBox ( Imagine\Image\BoxInterface $sourceBox, integer $width, integer $height, boolean $keepAspectRatio = true ) : Imagine\Image\BoxInterface | Returns box for an image to be created. | |
getThumbnailBox ( Imagine\Image\BoxInterface $sourceBox, integer $width, integer $height ) : Imagine\Image\BoxInterface | Returns box for a thumbnail to be created. If one of the dimensions is set to null, another one is calculated automatically based on width to height ratio of original image box. | |
isUpscaling ( Imagine\Image\BoxInterface $sourceBox, Imagine\Image\BoxInterface $destinationBox ) : boolean | Checks if upscaling is going to happen |
public static autorotate ( string | resource | Imagine\Image\ImageInterface $image, string $color = '000000' ) : Imagine\Image\ImageInterface | ||
$image | string | resource | Imagine\Image\ImageInterface | either ImageInterface, resource or a string containing file path |
$color | string | |
return | Imagine\Image\ImageInterface |
protected static createImagine ( ) : Imagine\Image\ImagineInterface | ||
return | Imagine\Image\ImagineInterface | the new `Imagine` object |
public static crop ( string | resource | Imagine\Image\ImageInterface $image, integer $width, integer $height, array $start = [0, 0] ) : Imagine\Image\ImageInterface | ||
$image | string | resource | Imagine\Image\ImageInterface | either ImageInterface, resource or a string containing file path |
$width | integer | the crop width |
$height | integer | the crop height |
$start | array | the starting point. This must be an array with two elements representing `x` and `y` coordinates. |
return | Imagine\Image\ImageInterface |
protected static ensureImageInterfaceInstance ( string | resource | Imagine\Image\ImageInterface $image ) : Imagine\Image\ImageInterface | ||
$image | string | resource | Imagine\Image\ImageInterface | |
return | Imagine\Image\ImageInterface |
public static frame ( string | resource | Imagine\Image\ImageInterface $image, integer $margin = 20, string $color = '666', integer $alpha = 100 ) : Imagine\Image\ImageInterface | ||
$image | string | resource | Imagine\Image\ImageInterface | either ImageInterface, resource or a string containing file path |
$margin | integer | the frame size to add around the image |
$color | string | the frame color |
$alpha | integer | the alpha value of the frame. |
return | Imagine\Image\ImageInterface |
protected static getBox ( Imagine\Image\BoxInterface $sourceBox, integer $width, integer $height, boolean $keepAspectRatio = true ) : Imagine\Image\BoxInterface | ||
$sourceBox | Imagine\Image\BoxInterface | original image box |
$width | integer | new image width |
$height | integer | new image height |
$keepAspectRatio | boolean | should we keep aspect ratio even if both with and height are set |
return | Imagine\Image\BoxInterface | new image box |
public static getImagine ( ) : Imagine\Image\ImagineInterface | ||
return | Imagine\Image\ImagineInterface | the `Imagine` object |
protected static getThumbnailBox ( Imagine\Image\BoxInterface $sourceBox, integer $width, integer $height ) : Imagine\Image\BoxInterface | ||
$sourceBox | Imagine\Image\BoxInterface | original image box |
$width | integer | thumbnail width |
$height | integer | thumbnail height |
return | Imagine\Image\BoxInterface | thumbnail box |
protected static isUpscaling ( Imagine\Image\BoxInterface $sourceBox, Imagine\Image\BoxInterface $destinationBox ) : boolean | ||
$sourceBox | Imagine\Image\BoxInterface | |
$destinationBox | Imagine\Image\BoxInterface | |
return | boolean |
public static resize ( string | resource | Imagine\Image\ImageInterface $image, integer $width, integer $height, boolean $keepAspectRatio = true, boolean $allowUpscaling = false ) : Imagine\Image\ImageInterface | ||
$image | string | resource | Imagine\Image\ImageInterface | either ImageInterface, resource or a string containing file path |
$width | integer | the width in pixels |
$height | integer | the height in pixels |
$keepAspectRatio | boolean | should the image keep aspect ratio |
$allowUpscaling | boolean | should the image be upscaled if needed |
return | Imagine\Image\ImageInterface |
public static setImagine ( Imagine\Image\ImagineInterface $imagine ) | ||
$imagine | Imagine\Image\ImagineInterface | the `Imagine` object. |
public static text ( string | resource | Imagine\Image\ImageInterface $image, string $text, string $fontFile, array $start = [0, 0], array $fontOptions = [] ) : Imagine\Image\ImageInterface | ||
$image | string | resource | Imagine\Image\ImageInterface | either ImageInterface, resource or a string containing file path |
$text | string | the text to write to the image |
$fontFile | string | the file path or path alias |
$start | array | the starting position of the text. This must be an array with two elements representing `x` and `y` coordinates. |
$fontOptions | array | the font options. The following options may be specified: - color: The font color. Defaults to "fff". - size: The font size. Defaults to 12. - angle: The angle to use to write the text. Defaults to 0. |
return | Imagine\Image\ImageInterface |
public static thumbnail ( string | resource | Imagine\Image\ImageInterface $image, integer $width, integer $height, string $mode = ManipulatorInterface::THUMBNAIL_OUTBOUND ) : Imagine\Image\ImageInterface | ||
$image | string | resource | Imagine\Image\ImageInterface | either ImageInterface, resource or a string containing file path |
$width | integer | the width in pixels to create the thumbnail |
$height | integer | the height in pixels to create the thumbnail |
$mode | string | mode of resizing original image to use in case both width and height specified |
return | Imagine\Image\ImageInterface |
public static watermark ( string | resource | Imagine\Image\ImageInterface $image, string | resource | Imagine\Image\ImageInterface $watermarkImage, array $start = [0, 0] ) : Imagine\Image\ImageInterface | ||
$image | string | resource | Imagine\Image\ImageInterface | either ImageInterface, resource or a string containing file path |
$watermarkImage | string | resource | Imagine\Image\ImageInterface | either ImageInterface, resource or a string containing watermark file path |
$start | array | the starting point. This must be an array with two elements representing `x` and `y` coordinates. |
return | Imagine\Image\ImageInterface |
public static $driver |
public static $thumbnailBackgroundAlpha |