Log in
Model

MediaGalleryProcessor

Magento\Catalog\Model\ProductRepository\MediaGalleryProcessor

What it does

This class handles the processing of product media gallery entries before saving a product through the ProductRepository.

Developers use this when working with product images programmatically, as it manages comparing existing images with new entries, handling image uploads, setting image roles (base, thumbnail, small_image), and marking images for removal.

It's automatically invoked by the ProductRepository but can be useful to understand when debugging image-related save operations.

Public Methods

  • processMediaGallery()
  • processNewMediaGalleryEntry()