Skip to content

Commit

Permalink
画像サイズ制限は対応しているもののみに
Browse files Browse the repository at this point in the history
  • Loading branch information
mei23 committed Jan 3, 2020
1 parent 3ffc7e2 commit 77fd399
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/misc/detect-mine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ const TYPE_SVG = {
export async function detectMine(path: string) {
let type = await detectType(path);

if (type.mime.startsWith('image/')) {
// 可能ならば画像のサイズチェックを行う
if (['image/jpeg', 'image/gif', 'image/png', 'image/apng', 'image/webp', 'image/bmp', 'image/tiff', 'image/svg+xml', 'image/vnd.adobe.photoshop'].includes(type.mime)) {
const imageSize = await detectImageSize(path).catch(() => null);

// うまく判定できない画像は octet-stream にする
Expand Down

0 comments on commit 77fd399

Please sign in to comment.