Log in
Model

Image

Magento\Catalog\Model\Product\Image

What it does

This class handles product image manipulation operations in Magento 2's catalog module.

Developers use it to resize, rotate, crop, and add watermarks to product images while managing image caching and quality settings.

It generates responsive product images for different display contexts (thumbnails, product pages, etc.) and optimizes them for web performance.

Public Methods

  • setWidth()
  • getWidth()
  • setHeight()
  • getHeight()
  • setQuality()
  • getQuality()
  • setKeepAspectRatio()
  • setKeepFrame()
  • setKeepTransparency()
  • setConstrainOnly()
  • setBackgroundColor()
  • setSize()
  • setBaseFile()
  • getBaseFile()
  • getNewFile()
  • isBaseFilePlaceholder()
  • setImageProcessor()
  • getImageProcessor()
  • resize()
  • rotate()
  • setAngle()
  • setWatermark()
  • saveFile()
  • getUrl()
  • setDestinationSubdir()
  • getDestinationSubdir()
  • isCached()
  • setWatermarkFile()
  • getWatermarkFile()
  • setWatermarkPosition()
  • getWatermarkPosition()
  • setWatermarkImageOpacity()
  • getWatermarkImageOpacity()
  • setWatermarkSize()
  • setWatermarkWidth()
  • getWatermarkWidth()
  • setWatermarkHeight()
  • getWatermarkHeight()
  • clearCache()
  • getResizedImageInfo()