diff --git a/js/views/attachment_view.js b/js/views/attachment_view.js index df0325e1a8..6fac465715 100644 --- a/js/views/attachment_view.js +++ b/js/views/attachment_view.js @@ -16,11 +16,9 @@ var ImageView = Backbone.View.extend({ tagName: 'img', initialize: function(objectUrl, contentType, blob) { - loadImage(blob, autoOrientedCanvas => { - this.source = autoOrientedCanvas.toDataURL(); + window.autoOrientImage(blob).then(dataURL => { + this.source = dataURL; this.render(); - }, { - orientation: true, }); }, events: { diff --git a/js/views/file_input_view.js b/js/views/file_input_view.js index fa5282fbb9..e44e9a2cb1 100644 --- a/js/views/file_input_view.js +++ b/js/views/file_input_view.js @@ -134,14 +134,7 @@ case 'audio': this.addThumb('images/audio.svg'); break; case 'video': this.addThumb('images/video.svg'); break; case 'image': - window.loadImage( - file, - autoOrientedCanvas => { - const objectUrl = autoOrientedCanvas.toDataURL(); - this.addThumb(objectUrl); - }, - {orientation: true}, - ); + window.autoOrientImage(file).then(this.addThumb.bind(this)); break; default: this.addThumb('images/file.svg'); break;