diff options
| author | MeiMei <30769358+mei23@users.noreply.github.com> | 2020-01-12 16:40:58 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-12 16:40:58 +0900 |
| commit | 9703ba53405b2f355c6e0317f714d82ff3d4dee3 (patch) | |
| tree | 4cd80df78b5c78bb60d47179836d393ee8d805d4 /src/misc/detect-url-mime.ts | |
| parent | Refactor (diff) | |
| download | misskey-9703ba53405b2f355c6e0317f714d82ff3d4dee3.tar.gz misskey-9703ba53405b2f355c6e0317f714d82ff3d4dee3.tar.bz2 misskey-9703ba53405b2f355c6e0317f714d82ff3d4dee3.zip | |
ファイルと画像認識処理の改善 (#5690)
* dimensions制限とリファクタ
* comment
* 不要な変更削除
* use fromFile など
* Add probe-image-size.d.ts
* えーCRLFで作るなよ…
* Update src/@types/probe-image-size.d.ts
Co-Authored-By: Acid Chicken (硫酸鶏) <root@acid-chicken.com>
* fix d.ts
* Update src/@types/probe-image-size.d.ts
Co-Authored-By: Acid Chicken (硫酸鶏) <root@acid-chicken.com>
* Update src/@types/probe-image-size.d.ts
Co-Authored-By: Acid Chicken (硫酸鶏) <root@acid-chicken.com>
* fix
Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com>
Diffstat (limited to '')
| -rw-r--r-- | src/misc/detect-url-mime.ts (renamed from src/misc/detect-url-mine.ts) | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/misc/detect-url-mine.ts b/src/misc/detect-url-mime.ts index eef64cfc56..8d71cd0137 100644 --- a/src/misc/detect-url-mine.ts +++ b/src/misc/detect-url-mime.ts @@ -1,14 +1,14 @@ import { createTemp } from './create-temp'; import { downloadUrl } from './donwload-url'; -import { detectMine } from './detect-mine'; +import { detectType } from './get-file-info'; -export async function detectUrlMine(url: string) { +export async function detectUrlMime(url: string) { const [path, cleanup] = await createTemp(); try { await downloadUrl(url, path); - const [type] = await detectMine(path); - return type; + const { mime } = await detectType(path); + return mime; } finally { cleanup(); } |