You've already forked pigallery2
mirror of
https://github.com/bpatrik/pigallery2.git
synced 2025-12-01 22:52:06 +02:00
removing mime dependency
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user