1
0
mirror of https://github.com/bpatrik/pigallery2.git synced 2025-11-27 22:38:10 +02:00

improving config check and setting

This commit is contained in:
Braun Patrik
2017-07-13 23:39:09 +02:00
parent 46af62c93f
commit 3a72f5e3d2
41 changed files with 587 additions and 255 deletions

View File

@@ -9,24 +9,21 @@ 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 = [
'bmp',
'gif',
'jpeg', 'jpg', 'jpe',
'png',
'tiff', 'tif',
'webp',
'ico',
'tga'
const extensions = [
'.bmp',
'.gif',
'.jpeg', '.jpg', '.jpe',
'.png',
'.tiff', '.tif',
'.webp',
'.ico',
'.tga'
];
let extension = path.extname(fullPath).toLowerCase();
return imageMimeTypes.indexOf(extension) !== -1;
const extension = path.extname(fullPath).toLowerCase();
return extensions.indexOf(extension) !== -1;
}
private static loadPhotoMetadata(fullPath: string): Promise<PhotoMetadata> {