Property | Type | Description | |
---|---|---|---|
$availableOptions | array | Available options | |
$height | integer | Original image height | |
$image | resource | Original image | |
$imageResized | resource | Image resized | |
$width | integer | Original image width |
Method | Description | |
---|---|---|
__construct ( string $filename = null ) | Initialize object | |
hex2rgb ( string $hexString ) : resource | Convert hexa string to rbg | |
open ( string $file ) : |
Open image | |
resize ( integer $newWidth, integer $newHeight, string $option = 'auto', string $backgroundColor = '#000000', integer $sourceX, integer $sourceY ) : |
Resize image | |
save ( string $savePath, integer $imageQuality = 90 ) : boolean | Save image |
Method | Description | |
---|---|---|
crop ( integer $newWidth, integer $newHeight, integer $sourceX, integer $sourceY ) : |
Crop image | |
getSizeByFixedHeight ( integer $newHeight ) : double | Get fixed height | |
getSizeByFixedWidth ( integer $newWidth ) : double | Get fixed width |
public __construct ( string $filename = null ) | ||
$filename | string | filename |
protected getSizeByFixedHeight ( integer $newHeight ) : double | ||
$newHeight | integer | New height |
return | double |
protected getSizeByFixedWidth ( integer $newWidth ) : double | ||
$newWidth | integer | New width |
return | double |
public resize ( integer $newWidth, integer $newHeight, string $option = 'auto', string $backgroundColor = '#000000', integer $sourceX, integer $sourceY ) : |
||
$newWidth | integer | New width |
$newHeight | integer | New height |
$option | string | Option can be (auto|crop) |
$backgroundColor | string | Background color |
$sourceX | integer | Source x |
$sourceY | integer | Source y |
return |
protected array $availableOptions | ||
return | array |