Replace `loadImage` with `autoOrientImage`

This commit is contained in:
Daniel Gasienica 2018-02-09 16:55:44 -05:00
parent 4431854923
commit c285bf5e33
2 changed files with 3 additions and 12 deletions

View File

@ -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: {

View File

@ -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;