diff --git a/app/assets/javascripts/discourse/views/composer/composer_view.js b/app/assets/javascripts/discourse/views/composer/composer_view.js index e43ce061762..d4ccda2b56b 100644 --- a/app/assets/javascripts/discourse/views/composer/composer_view.js +++ b/app/assets/javascripts/discourse/views/composer/composer_view.js @@ -385,8 +385,10 @@ Discourse.ComposerView = Discourse.View.extend(Ember.Evented, { var image = new Image(); image.onload = function() { // Create a new canvas. - var canvas = document.createElementNS('http://www.w3.org/1999/xhtml', 'canvas'), - ctx = canvas.getContext('2d'); + var canvas = document.createElementNS('http://www.w3.org/1999/xhtml', 'canvas'); + canvas.height = image.height; + canvas.width = image.width; + var ctx = canvas.getContext('2d'); ctx.drawImage(image, 0, 0); canvas.toBlob(function(blob) {