1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-12-13 06:08:58 +09:00

Update index.ts

This commit is contained in:
syuilo 2018-04-12 02:48:06 +09:00 committed by GitHub
parent c3f2cea0e6
commit 39d87305ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -56,11 +56,12 @@ function thumbnail(data: stream.Readable, type: string, resize: number): ISend {
const readable: stream.Readable = (() => {
// 動画であれば
if (/^video\/.*$/.test(type)) {
// 実装は先延ばし
// TODO
// 使わないことになったストリームはしっかり取り壊す
data.destroy();
return fs.createReadStream(`${__dirname}/assets/thumbnail-not-available.png`);
// 画像であれば
// Note: SVGはapplication/xml
} else if (/^image\/.*$/.test(type) || type == 'application/xml') {
// 0フレーム目を送る
try {