Skip to content

Commit

Permalink
Merge branch 'release/v1.0.13'
Browse files Browse the repository at this point in the history
  • Loading branch information
nocfer committed Jan 31, 2024
2 parents f14e276 + da0207c commit dfac4c9
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion default.env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
EXIFTOOL_CONFIG_FILE='/config/exiftool.config'
EXIFTOOL_CONFIG_FILE='../../../config/exiftool.config'
EXIFTOOL_SUPPORTED_EXTENSIONS='png;jpg;jpeg;cr2'
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "geotagger",
"version": "1.0.12",
"version": "1.0.13",
"main": "index.js",
"author": {
"name": "Ferdinando Nocera",
Expand Down
3 changes: 1 addition & 2 deletions src/application/exiftool/exiftool.types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export type PhotoMetadata = {
FileName: string;
SourceFile: string;
DateTimeOriginal: string;
Date: string;
};
2 changes: 1 addition & 1 deletion src/application/geotagger/geotagger.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const geotag = (photosDir: string, gpxFilePath: string) => {
const photosCreationDates = extractCreationDate(photosDir);

const mapped = photosCreationDates.map((photo) => {
const parsedPhotoDate = moment(photo.DateTimeOriginal, 'YYYY:MM:DD HH:mm:ss').toDate();
const parsedPhotoDate = moment(photo.Date, 'YYYY:MM:DD HH:mm:ss').toDate();

return findClosestGPXLogTime(gpx, parsedPhotoDate);
});
Expand Down
17 changes: 15 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
#!/usr/bin/env node

import { start } from './cli';
import * as cli from './cli';
import fs from 'fs';
const setup = () => {
const outFilePath = 'out/newGPX.gpx';

start();
if (!fs.existsSync(outFilePath)) {
fs.mkdirSync(outFilePath);
if (!fs.existsSync) throw new Error('Could not create "out" directory');
}
};
const main = () => {
setup();
cli.start();
};

main();

0 comments on commit dfac4c9

Please sign in to comment.