mirror of
https://github.com/bpatrik/pigallery2.git
synced 2024-11-28 08:58:49 +02:00
exif test
This commit is contained in:
parent
cca4ceead0
commit
7478c5106b
17
backend/model/exif.d.ts
vendored
17
backend/model/exif.d.ts
vendored
@ -10,6 +10,19 @@ declare module "node-iptc" {
|
||||
|
||||
|
||||
declare module "exif-parser" {
|
||||
export function create(data): any;
|
||||
export interface ExifData {
|
||||
tags: any;
|
||||
imageSize: any;
|
||||
}
|
||||
export interface ExifObject {
|
||||
parse(): ExifData;
|
||||
}
|
||||
export function create(data: any): ExifObject;
|
||||
|
||||
export function enableTagNames(value: boolean);
|
||||
|
||||
export function enableImageSize(value: boolean);
|
||||
|
||||
export function enableReturnTags(value: boolean);
|
||||
}
|
||||
|
||||
|
||||
|
@ -11,6 +11,9 @@ 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 = [
|
||||
@ -50,8 +53,10 @@ export class DiskMangerWorker {
|
||||
fs.stat(fullPath, (err, data) => {
|
||||
metadata.fileSize = data.size;
|
||||
});
|
||||
|
||||
try {
|
||||
const exif = exif_parser.create(data).parse();
|
||||
Logger.debug(LOG_TAG, "exif data", exif);
|
||||
metadata.cameraData = <CameraMetadata> {
|
||||
ISO: exif.tags.ISO,
|
||||
model: exif.tags.Model,
|
||||
|
Loading…
Reference in New Issue
Block a user