Replace `loadImage` with `autoOrientImage`
This commit is contained in:
parent
4431854923
commit
c285bf5e33
|
@ -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: {
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue