-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f0084ef
commit 6901b5a
Showing
467 changed files
with
709 additions
and
266 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,5 @@ db.json | |
docs/ | ||
node_modules/ | ||
XXX/ | ||
HexoCommand* | ||
HexoCommand* | ||
photos_original/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
'use strict'; | ||
|
||
/** | ||
* node "./lib/_once_process_meta_original.js" | ||
*/ | ||
|
||
const { red } = require('chalk'); | ||
|
||
const fs = require("fs"); | ||
const path = require("path"); | ||
|
||
const exifr = require('exifr'); | ||
const originalFolder = "../photos_original/temp"; | ||
const poolFolder = "../static/pool"; | ||
const metaFolder = "../static/photos/meta"; | ||
|
||
const _currentPath = __dirname; | ||
|
||
let _originalFolder = path.join(_currentPath, originalFolder); | ||
let _poolFolder = path.join(_currentPath, poolFolder); | ||
let _metaFolder = path.join(_currentPath, metaFolder);; | ||
|
||
const orgFiles = fs.readdirSync(_originalFolder); | ||
|
||
// return; //DONT RUN AGAIN! | ||
|
||
const jpgFiles = orgFiles | ||
.filter(file => { | ||
return path.extname(file).toLowerCase() === ".jpg"; | ||
}) | ||
.sort(); | ||
|
||
if (jpgFiles.length === 0) return; | ||
|
||
jpgFiles.forEach((file) => { | ||
|
||
const imgFile = path.join(_originalFolder, file); | ||
|
||
const folder = file.replace(path.extname(file), ''); | ||
|
||
let metaFile; | ||
|
||
const existingPoolFolder = path.join(_poolFolder, folder); | ||
if (fs.existsSync(existingPoolFolder)) { | ||
metaFile = path.join(existingPoolFolder, "meta.json"); | ||
} else { | ||
metaFile = path.join(_metaFolder, folder + ".json"); | ||
} | ||
|
||
exifr.parse(imgFile, { xmp: true, iptc: true }).then(output => { | ||
|
||
const custom = { | ||
"custom": { | ||
"name": folder, | ||
"links": [ | ||
{ | ||
"site": "500px", | ||
"url": "" | ||
}, | ||
{ | ||
"site": "pixelfed", | ||
"url": "" | ||
} | ||
] | ||
} | ||
}; | ||
|
||
const meta = { ...custom, ...output }; | ||
|
||
let msg = "Meta Data parsed for '" + file + " -> " + meta.ObjectName + "' -> " + metaFile; | ||
if (meta.ObjectName === undefined) { | ||
console.log(red(msg)); | ||
} else { | ||
console.log(msg); | ||
} | ||
|
||
fs.writeFile(metaFile, JSON.stringify(meta), err => { | ||
if (err) { console.error(err); } | ||
}); | ||
|
||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,5 @@ | |
title: {{ title }} | ||
date: {{ date }} | ||
photograph: | ||
file: | ||
file: | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
--- | ||
title: Projects | ||
permalink: /projects | ||
photograph: | ||
file: $projects.jpg | ||
file: $19-05 Israel-0245.jpg | ||
name: Ancient Mosaic | ||
link: 'https://500px.com/photo/1057290585' | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.