Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Public Member Functions | |
__construct (\Magento\Framework\App\Helper\Context $context, \Magento\Catalog\Model\Product\ImageFactory $productImageFactory, \Magento\Framework\View\Asset\Repository $assetRepo, \Magento\Framework\View\ConfigInterface $viewConfig, \Magento\Catalog\Model\View\Asset\PlaceholderFactory $placeholderFactory=null) | |
init ($product, $imageId, $attributes=[]) | |
resize ($width, $height=null) | |
setQuality ($quality) | |
keepAspectRatio ($flag) | |
keepFrame ($flag) | |
keepTransparency ($flag) | |
constrainOnly ($flag) | |
backgroundColor ($colorRGB) | |
rotate ($angle) | |
watermark ($fileName, $position, $size=null, $imageOpacity=null) | |
placeholder ($fileName) | |
getPlaceholder ($placeholder=null) | |
getUrl () | |
save () | |
getResizedImageInfo () | |
getDefaultPlaceholderUrl ($placeholder=null) | |
setWatermarkSize ($size) | |
setWatermarkImageOpacity ($imageOpacity) | |
setImageFile ($file) | |
getOriginalWidth () | |
getOriginalHeight () | |
getOriginalSizeArray () | |
getType () | |
getWidth () | |
getHeight () | |
getFrame () | |
getLabel () | |
![]() | |
__construct (Context $context) | |
isModuleOutputEnabled ($moduleName=null) | |
Data Fields | |
const | MEDIA_TYPE_CONFIG_NODE = 'images' |
Protected Member Functions | |
_reset () | |
setImageProperties () | |
setWatermarkProperties () | |
applyScheduledActions () | |
initBaseFile () | |
isScheduledActionsAllowed () | |
_getModel () | |
setAngle ($angle) | |
getAngle () | |
setWatermark ($watermark) | |
getWatermark () | |
setWatermarkPosition ($position) | |
getWatermarkPosition () | |
getWatermarkSize () | |
getWatermarkImageOpacity () | |
setProduct ($product) | |
getProduct () | |
getImageFile () | |
parseSize ($string) | |
getConfigView () | |
getAttribute ($name) | |
![]() | |
_getRequest () | |
_getModuleName () | |
_getUrl ($route, $params=[]) | |
Protected Attributes | |
$_model | |
$_scheduleResize = true | |
$_scheduleRotate = false | |
$_angle | |
$_watermark | |
$_watermarkPosition | |
$_watermarkSize | |
$_watermarkImageOpacity | |
$_product | |
$_imageFile | |
$_placeholder | |
$_assetRepo | |
$_productImageFactory | |
$viewConfig | |
$configView | |
$attributes = [] | |
![]() | |
$_moduleName | |
$_request | |
$_moduleManager | |
$_logger | |
$_urlBuilder | |
$_httpHeader | |
$_eventManager | |
$_remoteAddress | |
$urlEncoder | |
$urlDecoder | |
$scopeConfig | |
$_cacheConfig | |
__construct | ( | \Magento\Framework\App\Helper\Context | $context, |
\Magento\Catalog\Model\Product\ImageFactory | $productImageFactory, | ||
\Magento\Framework\View\Asset\Repository | $assetRepo, | ||
\Magento\Framework\View\ConfigInterface | $viewConfig, | ||
\Magento\Catalog\Model\View\Asset\PlaceholderFactory | $placeholderFactory = null |
||
) |
\Magento\Framework\App\Helper\Context | $context | |
\Magento\Catalog\Model\Product\ImageFactory | $productImageFactory | |
\Magento\Framework\View\Asset\Repository | $assetRepo | |
\Magento\Framework\View\ConfigInterface | $viewConfig | |
\Magento\Catalog\Model\View\Asset\PlaceholderFactory | $placeholderFactory |
Definition at line 142 of file Image.php.
|
protected |
|
protected |
Apply scheduled actions
Definition at line 468 of file Image.php.
backgroundColor | ( | $colorRGB | ) |
constrainOnly | ( | $flag | ) |
|
protected |
|
protected |
getDefaultPlaceholderUrl | ( | $placeholder = null | ) |
getFrame | ( | ) |
getOriginalHeight | ( | ) |
getOriginalSizeArray | ( | ) |
getOriginalWidth | ( | ) |
getPlaceholder | ( | $placeholder = null | ) |
Get Placeholder
null | string | $placeholder |
Definition at line 451 of file Image.php.
|
protected |
getResizedImageInfo | ( | ) |
getUrl | ( | ) |
Retrieve image URL
Definition at line 525 of file Image.php.
|
protected |
|
protected |
|
protected |
|
protected |
init | ( | $product, | |
$imageId, | |||
$attributes = [] |
|||
) |
Initialize Helper to work with Image
\Magento\Catalog\Model\Product | $product | |
string | $imageId | |
array | $attributes |
Definition at line 186 of file Image.php.
|
protected |
|
protected |
keepAspectRatio | ( | $flag | ) |
keepFrame | ( | $flag | ) |
Guarantee, that image will have dimensions, set in $width/$height Applicable before calling resize() Not applicable, if keepAspectRatio(false)
$position - TODO, not used for now - picture position inside the frame.
bool | $flag |
Definition at line 335 of file Image.php.
keepTransparency | ( | $flag | ) |
Guarantee, that image will not lose transparency if any. Applicable before calling resize() It is true by default.
$alphaOpacity - TODO, not used for now
bool | $flag |
Definition at line 353 of file Image.php.
|
protected |
Retrieve size from string
string | $string |
placeholder | ( | $fileName | ) |
Set placeholder
string | $fileName |
resize | ( | $width, | |
$height = null |
|||
) |
rotate | ( | $angle | ) |
|
protected |
setImageFile | ( | $file | ) |
|
protected |
|
protected |
setQuality | ( | $quality | ) |
|
protected |
setWatermarkImageOpacity | ( | $imageOpacity | ) |
|
protected |
|
protected |
Set watermark properties
Definition at line 251 of file Image.php.
setWatermarkSize | ( | $size | ) |
watermark | ( | $fileName, | |
$position, | |||
$size = null , |
|||
$imageOpacity = null |
|||
) |