1
Fork 0

Fix bug where iso is not parsed at a number

This commit is contained in:
viktorstrate 2019-08-11 15:44:05 +02:00
parent 7bc29c3ec7
commit 52ca60e240
1 changed files with 11 additions and 1 deletions

View File

@ -17,6 +17,16 @@ async function addExifTags({ session, photo }) {
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 = {
camera: rawTags.Model,
maker: rawTags.Make,
@ -27,7 +37,7 @@ async function addExifTags({ session, photo }) {
fileSize: rawTags.FileSize,
exposure: rawTags.ShutterSpeedValue,
aperture: rawTags.ApertureValue,
iso: rawTags.ISO,
iso,
focalLength: rawTags.FocalLength,
flash: rawTags.Flash,
}