removing mime dependency
This commit is contained in:
parent
e66886ffcb
commit
7e3a0322c2
@ -4,28 +4,27 @@ import {CameraMetadata, GPSMetadata, ImageSize, PhotoDTO, PhotoMetadata} from ".
|
|||||||
import {Logger} from "../../Logger";
|
import {Logger} from "../../Logger";
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import * as path from "path";
|
import * as path from "path";
|
||||||
import * as mime from "mime";
|
|
||||||
import * as iptc from "node-iptc";
|
import * as iptc from "node-iptc";
|
||||||
import * as exif_parser from "exif-parser";
|
import * as exif_parser from "exif-parser";
|
||||||
import {ProjectPath} from "../../ProjectPath";
|
import {ProjectPath} from "../../ProjectPath";
|
||||||
|
|
||||||
const LOG_TAG = "[DiskManagerTask]";
|
const LOG_TAG = "[DiskManagerTask]";
|
||||||
|
|
||||||
|
|
||||||
export class DiskMangerWorker {
|
export class DiskMangerWorker {
|
||||||
private static isImage(fullPath: string) {
|
private static isImage(fullPath: string) {
|
||||||
let imageMimeTypes = [
|
let imageMimeTypes = [
|
||||||
'image/bmp',
|
'bmp',
|
||||||
'image/gif',
|
'gif',
|
||||||
'image/jpeg',
|
'jpeg', 'jpg', 'jpe',
|
||||||
'image/png',
|
'png',
|
||||||
'image/pjpeg',
|
'tiff', 'tif',
|
||||||
'image/tiff',
|
'webp',
|
||||||
'image/webp',
|
'ico',
|
||||||
'image/x-tiff',
|
'tga'
|
||||||
'image/x-windows-bmp'
|
|
||||||
];
|
];
|
||||||
|
|
||||||
let extension = mime.lookup(fullPath);
|
let extension = path.extname(fullPath).toLowerCase();
|
||||||
|
|
||||||
return imageMimeTypes.indexOf(extension) !== -1;
|
return imageMimeTypes.indexOf(extension) !== -1;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,7 +25,6 @@
|
|||||||
"url": "https://github.com/bpatrik/PiGallery2/issues"
|
"url": "https://github.com/bpatrik/PiGallery2/issues"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/bcryptjs": "2.4.0",
|
|
||||||
"bcryptjs": "2.4.3",
|
"bcryptjs": "2.4.3",
|
||||||
"body-parser": "1.17.2",
|
"body-parser": "1.17.2",
|
||||||
"ejs": "2.5.6",
|
"ejs": "2.5.6",
|
||||||
@ -34,7 +33,6 @@
|
|||||||
"express-session": "1.15.3",
|
"express-session": "1.15.3",
|
||||||
"flat-file-db": "1.0.0",
|
"flat-file-db": "1.0.0",
|
||||||
"jimp": "0.2.28",
|
"jimp": "0.2.28",
|
||||||
"mime": "1.3.6",
|
|
||||||
"mysql": "2.13.0",
|
"mysql": "2.13.0",
|
||||||
"node-iptc": "1.0.4",
|
"node-iptc": "1.0.4",
|
||||||
"reflect-metadata": "0.1.10",
|
"reflect-metadata": "0.1.10",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user