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?

  • Hello Andrej and welcome to SE, would you please add more details to your question? – Phoenix128_RiccardoT Jul 19 '16 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. – Andrej Wasemiller Jul 19 '16 at 15:13
  • Hi @AndrejWasemiller could u please suggest on magento.stackexchange.com/questions/268126/… – NIPPU Apr 2 at 9:24
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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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