|
|
@ -274,15 +274,23 @@
|
|
|
|
this.addThumb(dataUrl);
|
|
|
|
this.addThumb(dataUrl);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
if (Signal.Util.GoogleChrome.isImageTypeSupported(contentType)) {
|
|
|
|
if (Signal.Util.GoogleChrome.isImageTypeSupported(contentType)) {
|
|
|
|
renderImagePreview();
|
|
|
|
await renderImagePreview();
|
|
|
|
} else if (Signal.Util.GoogleChrome.isVideoTypeSupported(contentType)) {
|
|
|
|
} else if (Signal.Util.GoogleChrome.isVideoTypeSupported(contentType)) {
|
|
|
|
renderVideoPreview();
|
|
|
|
await renderVideoPreview();
|
|
|
|
} else if (MIME.isAudio(contentType)) {
|
|
|
|
} else if (MIME.isAudio(contentType)) {
|
|
|
|
this.addThumb('images/audio.svg');
|
|
|
|
this.addThumb('images/audio.svg');
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.addThumb('images/file.svg');
|
|
|
|
this.addThumb('images/file.svg');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
|
|
console.log(
|
|
|
|
|
|
|
|
`Was unable to generate thumbnail for file type ${contentType}`,
|
|
|
|
|
|
|
|
e && e.stack ? e.stack : e
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
this.addThumb('images/file.svg');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const blob = await this.autoScale(file);
|
|
|
|
const blob = await this.autoScale(file);
|
|
|
|
let limitKb = 1000000;
|
|
|
|
let limitKb = 1000000;
|
|
|
|