1

In Backend -> PRODUCTS -> CATALOG -> [any product] -> Images and Videos when uploading images, Magento automatically makes resize(max-width 1920px). I need a image width 2600px. each product with self background. I created the Image-attribute: produkt_bg and show it on the product page. but the width is not enough.

How do I change this or turn it off in backend for uploading image default MAX WIDTH?

3
  • Hello Andrej and welcome to SE, would you please add more details to your question? Jul 19, 2016 at 14:14
  • Backend -> PRODUCTS -> CATALOG -> [any product] -> Images and Videos. when uploading images, Magento automatically makes resize(max-width 1920px). I need a image width 2600px. each product with self background. I created the Image-attribute: produkt_bg and show it on the product page. but the width is not enough. Jul 19, 2016 at 15:13
  • Hi @AndrejWasemiller could u please suggest on magento.stackexchange.com/questions/268126/… Apr 2, 2019 at 9:24

3 Answers 3

1

After a lot of digging in the code, I found that M2 resize the image on the client, that's it, before even uploading to the server. This will be true if you use a browser that support Canvas and the File API.

To prevent this, you have to remove:

// vendor/magento/module-backend/view/adminhtml/web/js/media-uploader.js:113
{
     action: 'resize',
     maxWidth: this.options.maxWidth,
     maxHeight: this.options.maxHeight
},

To be honest, I don't know exactly how to remove it in a clean way. The "easy way" would be remapping Magento_Backend/js/media-uploader to a custom js file and brutally copy/paste.

By the way, the above file is called here:
vendor/magento/module-backend/view/adminhtml/templates/media/uploader.phtml

1
0

Some clarification:

The upload image size limitation is done in multiple area :

  • Upload images on configurable product creation steps:

    vendor/magento/module-configurable-product/view/adminhtml/web/js/variations/steps/bulk.js:317

  • Upload image for a product

    vendor/magento/module-backend/view/adminhtml/templates/media/uploader.phtml:17

  • Upload image for CMS

    vendor/magento/module-cms/view/adminhtml/templates/browser/content/uploader.phtml:103

  • Abstract class with the constant value

    vendor/magento/framework/File/Uploader.php:138

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

0

In Magento 2.2.3 the max image sizes can be found in /vendor/magento/framework/File/Uploader.php

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.