Magento – Control placeholder image width/height in magento 2

magento2placeholderproduct-images

I can control the product images width/height in view.xml located in app/design/<vendor>/<theme>/etc in product list page. Some of the products not having images so it tries to show placeholder image. But placeholder width/height is not able to control in view.xml

<image id="category_page_grid" type="small_image">
    <width>240</width>
    <height>240</height>
 </image>
<image id="category_page_list" type="small_image">
     <width>240</width>
     <height>240</height>
</image>
<image id="product_small_image" type="small_image">
     <width>240</width>
     <height>240</height>
</image>

Best Answer

The placeholder images will use the same values to resize as the product image do. So the config you provided will also resize the placeholder images.

You have to make sure to add your own placeholder images in Magento's backend at Configuration> Catalog > Catalog >Product Image Placeholders. Also remember to re-upload the images in the backend after you change the values in view.xml.

Related Topic