1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2025-01-14 14:43:17 +08:00

exif test fix

This commit is contained in:
Braun Patrik 2017-07-11 18:43:10 +02:00
parent 7478c5106b
commit 07619e2f05
3 changed files with 12 additions and 10 deletions

View File

@ -15,14 +15,13 @@ declare module "exif-parser" {
imageSize: any;
}
export interface ExifObject {
enableTagNames(value: boolean);
enableImageSize(value: boolean);
enableReturnTags(value: boolean);
parse(): ExifData;
}
export function create(data: any): ExifObject;
export function enableTagNames(value: boolean);
export function enableImageSize(value: boolean);
export function enableReturnTags(value: boolean);
}

View File

@ -11,9 +11,6 @@ import {ProjectPath} from "../../ProjectPath";
const LOG_TAG = "[DiskManagerTask]";
exif_parser.enableTagNames(true);
exif_parser.enableImageSize(true);
exif_parser.enableReturnTags(true);
export class DiskMangerWorker {
private static isImage(fullPath: string) {
let imageMimeTypes = [
@ -55,7 +52,13 @@ export class DiskMangerWorker {
});
try {
const exif = exif_parser.create(data).parse();
const exif_obj = exif_parser.create(data);
exif_obj.enableTagNames(true);
exif_obj.enableImageSize(true);
exif_obj.enableReturnTags(true);
const exif = exif_obj.parse();
Logger.debug(LOG_TAG, "exif data", exif);
metadata.cameraData = <CameraMetadata> {
ISO: exif.tags.ISO,

View File

@ -8,7 +8,7 @@
"main": "./backend/index.js",
"bin": "./backend/index.js",
"scripts": {
"build": "ng build",
"build": "tsc && ng build",
"pretest": "tsc",
"test": "ng test --single-run && mocha --recursive test/backend/unit",
"start": "node ./backend/index",