You cannot specify a percentage on thumbnailWidth and thumbnailHeight . Dropzone uses these values ββto create an image source to show it as a preview.
But you can leave the thumbnail with the original width and height by setting these values ββto null (note that this may cause a slight delay with high resolution images), and then use the <img> width and height attributes to display the image with the desired size and configure the .dz-image container with css.
html:
<div class="dropzone" id="myDropzone"></div>
JS:
Dropzone.autoDiscover = false; Dropzone.options.myDropzone = { url: "yourUrl", thumbnailWidth: null, thumbnailHeight: null, init: function() { this.on("thumbnail", function(file, dataUrl) { $('.dz-image').last().find('img').attr({width: '100%', height: '100%'}); }), this.on("success", function(file) { $('.dz-image').css({"width":"100%", "height":"auto"}); }) } }; var myDropzone = new Dropzone('div#myDropzone');
source share