Default uploading image size in Magento 2

The question:

I met one strange issue in Magento 2 – I’m trying to change default uploading image size from 800x1200 to 934x1400.

I modified view.xml and now uploaded images going straight to folder media/catalog/product/cache/1/image/934x1400/

<image id="product_page_main_image" type="image">
<image id="product_page_main_image_default" type="image">
<image id="product_page_image_large" type="image">
                <width>934</width><!-- 800 -->
                <height>1400</height><!-- 1090 -->
<image id="product_page_image_medium" type="image">
                <width>934</width><!-- 800 -->
                <height>1400</height><!-- 1090 -->

But their actual size is still 800x1200

Any ideas how to solve this issue? I can’t find any settings to modify default uploading image size.

The Solutions:

Below are the methods you can try. The first solution is probably the best. Try others if the first one doesn’t work. Senior developers aren’t just copying/pasting – they read the methods carefully & apply them wisely to each case.

Method 1

There are two ways to change max resizing width & height of the image after uploading:

1) MagentoFrameworkFileUploader.php contain constants MAX_IMAGE_HEIGHT & MAX_IMAGE_WIDTH which is set to 1200 by default

2) magento/module-backend/view/adminhtml/templates/media/uploader.phtml contains PHP code for echo same constants MAX_IMAGE_HEIGHT and MAX_IMAGE_WIDTH. You can just hardcode your value instead these values.

Method 2

Some clarification:

The upload image size limitation is done in multiple area :

Upload images on configurable product creation steps:


Upload image for a product


Upload image for CMS


Abstract class with the constant value


To my mind Magento has not finished to implement correctly this feature because the value is harcoded for the configurable creation.

All methods was sourced from or, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Comment