album-exif-analyzer
Advanced tools
Comparing version 1.0.5 to 1.0.6
32
index.js
@@ -6,5 +6,12 @@ #!/usr/bin/env node | ||
const fs = require("fs"); | ||
// const cr2Raw = require("cr2-raw"); | ||
const filestream = readdirp(process.cwd(), { | ||
fileFilter: ["*.png", "*.jpg", "*.jpeg", "*.cr2"], | ||
fileFilter: (entry) => { | ||
if (/\.(png|jp(e)?g|cr2)$/i.exec(entry.fullPath)) { | ||
return true; | ||
} else { | ||
return false; | ||
} | ||
}, | ||
depth: 50, | ||
@@ -14,3 +21,3 @@ }); | ||
let gotHeader = false; | ||
const separator = "|"; | ||
const separator = ","; | ||
@@ -37,7 +44,12 @@ const outputFile = `${Date.now()}-album-exif-analyzer.csv`; | ||
} | ||
let tempS; | ||
if (Buffer.isBuffer(exifData[j][i])) { | ||
s += exifData[j][i].toString("hex"); | ||
tempS = exifData[j][i].toString("hex"); | ||
} else { | ||
s += exifData[j][i].toString(); | ||
tempS = exifData[j][i].toString(); | ||
} | ||
if (tempS.includes(",")) { | ||
tempS = `"${tempS}"`; | ||
} | ||
s += tempS; | ||
} | ||
@@ -58,8 +70,18 @@ s += "\n"; | ||
try { | ||
data = await exif.read(entry.path); | ||
if (/cr2/i.exec(entry.fullPath)) { | ||
console.log(`CR2 format isn't supported currently; cannot parse ${entry.fullPath}`); | ||
numProcessing--; | ||
return; | ||
// const o = cr2Raw(entry.fullPath).fetchMeta("exif"); | ||
} else { | ||
data = await exif.read(entry.fullPath, true); | ||
} | ||
} catch (e) { | ||
console.log(`No EXIF data in ${entry.fullPath}`); | ||
numProcessing--; | ||
return; | ||
} | ||
console.log(data); | ||
if (data === null) { | ||
console.log(`No EXIF data in ${entry.fullPath}`); | ||
numProcessing--; | ||
@@ -66,0 +88,0 @@ return; |
{ | ||
"name": "album-exif-analyzer", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Recursively extracts EXIF data of all of the photos in a directory into a analyzable format", | ||
@@ -10,2 +10,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"cr2-raw": "^1.1.0", | ||
"fast-exif": "^1.0.1", | ||
@@ -12,0 +13,0 @@ "lock": "^1.1.0", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4724
92
4
+ Addedcr2-raw@^1.1.0
+ Addedcr2-raw@1.1.0(transitive)