From 7e3a0322c25ff274abddbb17644b4697959b2c52 Mon Sep 17 00:00:00 2001 From: Braun Patrik Date: Thu, 13 Jul 2017 19:13:26 +0200 Subject: [PATCH] removing mime dependency --- backend/model/threading/DiskMangerWorker.ts | 21 ++++++++++----------- package.json | 2 -- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/backend/model/threading/DiskMangerWorker.ts b/backend/model/threading/DiskMangerWorker.ts index 876e075a..82c7f1d5 100644 --- a/backend/model/threading/DiskMangerWorker.ts +++ b/backend/model/threading/DiskMangerWorker.ts @@ -4,28 +4,27 @@ import {CameraMetadata, GPSMetadata, ImageSize, PhotoDTO, PhotoMetadata} from ". import {Logger} from "../../Logger"; import * as fs from "fs"; import * as path from "path"; -import * as mime from "mime"; import * as iptc from "node-iptc"; import * as exif_parser from "exif-parser"; import {ProjectPath} from "../../ProjectPath"; const LOG_TAG = "[DiskManagerTask]"; + export class DiskMangerWorker { private static isImage(fullPath: string) { let imageMimeTypes = [ - 'image/bmp', - 'image/gif', - 'image/jpeg', - 'image/png', - 'image/pjpeg', - 'image/tiff', - 'image/webp', - 'image/x-tiff', - 'image/x-windows-bmp' + 'bmp', + 'gif', + 'jpeg', 'jpg', 'jpe', + 'png', + 'tiff', 'tif', + 'webp', + 'ico', + 'tga' ]; - let extension = mime.lookup(fullPath); + let extension = path.extname(fullPath).toLowerCase(); return imageMimeTypes.indexOf(extension) !== -1; } diff --git a/package.json b/package.json index afe420bc..c7d83b06 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,6 @@ "url": "https://github.com/bpatrik/PiGallery2/issues" }, "dependencies": { - "@types/bcryptjs": "2.4.0", "bcryptjs": "2.4.3", "body-parser": "1.17.2", "ejs": "2.5.6", @@ -34,7 +33,6 @@ "express-session": "1.15.3", "flat-file-db": "1.0.0", "jimp": "0.2.28", - "mime": "1.3.6", "mysql": "2.13.0", "node-iptc": "1.0.4", "reflect-metadata": "0.1.10",