To Retrieve Media Images Roles type from the Product in Magento 2 is useful to know each image role whether its small_image, thumbnail, or swatch image.
When you create a product, you need to assigned roles based on its display position.
The Base
Role will be displayed on the product detail page.
A small
Role will be displayed on the category listing page.
The Thumbnail
Role will be displayed on the Shopping Cart page.
Swatch image
Role will be displayed on the product swatches. Continue reading “How to get Image roles types from product programmatically Magento 2?”