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– Phoenix128_RiccardoT2016年07月19日 14:14:55 +00:00Commented 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.Andrej Wasemiller– Andrej Wasemiller2016年07月19日 15:13:48 +00:00Commented Jul 19, 2016 at 15:13
-
Hi @AndrejWasemiller could u please suggest on magento.stackexchange.com/questions/268126/…Nagaraju Kasa– Nagaraju Kasa2019年04月02日 09:24:58 +00:00Commented Apr 2, 2019 at 9:24
3 Answers 3
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
-
@lazel could u please suggest on my post magento.stackexchange.com/questions/268126/…Nagaraju Kasa– Nagaraju Kasa2019年04月02日 09:25:21 +00:00Commented Apr 2, 2019 at 9:25
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:317Upload image for a product
vendor/magento/module-backend/view/adminhtml/templates/media/uploader.phtml:17Upload image for CMS
vendor/magento/module-cms/view/adminhtml/templates/browser/content/uploader.phtml:103Abstract 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.
In Magento 2.2.3 the max image sizes can be found in /vendor/magento/framework/File/Uploader.php
-
please advise on magento.stackexchange.com/questions/268126/…Nagaraju Kasa– Nagaraju Kasa2019年04月02日 09:40:34 +00:00Commented Apr 2, 2019 at 9:40