메소드 | 설명 | |
---|---|---|
__construct ( Imagine\Image\ImagineInterface $imagine, |
Constructor | |
normalizeResizeParameters ( integer $width, integer $height, array $params = [] ) : array | Calculate the parameters for resizing an image | |
resize ( string $source, string $destination = null, array $params = [] ) : boolean | Crop and resize an image |
public __construct ( Imagine\Image\ImagineInterface $imagine, |
||
$imagine | Imagine\Image\ImagineInterface | Imagine interface |
$config | Elgg config |
public normalizeResizeParameters ( integer $width, integer $height, array $params = [] ) : array | ||
$width | integer | Natural width of the image |
$height | integer | Natural height of the image |
$params | array | Resize parameters - 'w' maximum width of the resized image - 'h' maximum height of the resized image - 'upscale' allow upscaling - 'square' constrain to a square - 'x1', 'y1', 'x2', 'y2' cropping coordinates |
리턴 | array |
public resize ( string $source, string $destination = null, array $params = [] ) : boolean | ||
$source | string | Path to source image |
$destination | string | Path to destination If not set, will modify the source image |
$params | array | An array of cropping/resizing parameters - INT 'w' represents the width of the new image With upscaling disabled, this is the maximum width of the new image (in case the source image is smaller than the expected width) - INT 'h' represents the height of the new image With upscaling disabled, this is the maximum height - INT 'x1', 'y1', 'x2', 'y2' represent optional cropping coordinates. The source image will first be cropped to these coordinates, and then resized to match width/height parameters - BOOL 'square' - square images will fill the bounding box (width x height). In Imagine's terms, this equates to OUTBOUND mode - BOOL 'upscale' - if enabled, smaller images will be upscaled to fit the bounding box. |
리턴 | boolean |