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:
parent
7478c5106b
commit
07619e2f05
9
backend/model/exif.d.ts
vendored
9
backend/model/exif.d.ts
vendored
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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",
|
||||
|
Loading…
x
Reference in New Issue
Block a user