Fix bug where iso is not parsed at a number
This commit is contained in:
parent
7bc29c3ec7
commit
52ca60e240
|
@ -17,6 +17,16 @@ async function addExifTags({ session, photo }) {
|
||||||
|
|
||||||
const rawTags = await exiftool.read(photo.path)
|
const rawTags = await exiftool.read(photo.path)
|
||||||
|
|
||||||
|
let iso = rawTags.ISO
|
||||||
|
if (typeof iso != 'Number') {
|
||||||
|
try {
|
||||||
|
iso = parseInt(iso)
|
||||||
|
} catch (e) {
|
||||||
|
console.log('Could not parse ISO as int', e, e.stack)
|
||||||
|
iso = undefined
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const photoExif = {
|
const photoExif = {
|
||||||
camera: rawTags.Model,
|
camera: rawTags.Model,
|
||||||
maker: rawTags.Make,
|
maker: rawTags.Make,
|
||||||
|
@ -27,7 +37,7 @@ async function addExifTags({ session, photo }) {
|
||||||
fileSize: rawTags.FileSize,
|
fileSize: rawTags.FileSize,
|
||||||
exposure: rawTags.ShutterSpeedValue,
|
exposure: rawTags.ShutterSpeedValue,
|
||||||
aperture: rawTags.ApertureValue,
|
aperture: rawTags.ApertureValue,
|
||||||
iso: rawTags.ISO,
|
iso,
|
||||||
focalLength: rawTags.FocalLength,
|
focalLength: rawTags.FocalLength,
|
||||||
flash: rawTags.Flash,
|
flash: rawTags.Flash,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue