Image
Magento\Catalog\Helper\Image
What it does
This helper class provides a fluent interface for generating and manipulating product images in Magento 2.
Developers use it to create resized, watermarked, or rotated versions of product images with specific dimensions, quality settings, and display properties.
It's commonly used in templates and blocks to render product images with the correct size and formatting for different contexts like product listings, detail pages, or thumbnails.
Public Methods
- init()
- resize()
- setQuality()
- keepAspectRatio()
- keepFrame()
- keepTransparency()
- constrainOnly()
- backgroundColor()
- rotate()
- watermark()
- placeholder()
- getPlaceholder()
- getUrl()
- save()
- getResizedImageInfo()
- getDefaultPlaceholderUrl()
- setWatermarkSize()
- setWatermarkImageOpacity()
- setImageFile()
- getOriginalWidth()
- getOriginalHeight()
- getOriginalSizeArray()
- getType()
- getWidth()
- getHeight()
- getFrame()
- getLabel()