From 07619e2f05c5e0692327ecd201e9cc8cccdcba04 Mon Sep 17 00:00:00 2001 From: Braun Patrik Date: Tue, 11 Jul 2017 18:43:10 +0200 Subject: [PATCH] exif test fix --- backend/model/exif.d.ts | 9 ++++----- backend/model/threading/DiskMangerWorker.ts | 11 +++++++---- package.json | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/backend/model/exif.d.ts b/backend/model/exif.d.ts index 6afc74dd..7a1651dd 100644 --- a/backend/model/exif.d.ts +++ b/backend/model/exif.d.ts @@ -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); } diff --git a/backend/model/threading/DiskMangerWorker.ts b/backend/model/threading/DiskMangerWorker.ts index 3598ccc8..543a56da 100644 --- a/backend/model/threading/DiskMangerWorker.ts +++ b/backend/model/threading/DiskMangerWorker.ts @@ -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 = { ISO: exif.tags.ISO, diff --git a/package.json b/package.json index e00edf42..8a02b6e4 100644 --- a/package.json +++ b/package.json @@ -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",