diff --git a/src/components/import/ImportSingleFile.tsx b/src/components/import/ImportSingleFile.tsx index e75bac5..42acb41 100644 --- a/src/components/import/ImportSingleFile.tsx +++ b/src/components/import/ImportSingleFile.tsx @@ -108,6 +108,13 @@ const ImportSingleFile: Component = ({ file: file }) => { async () => { const imageUrl = reader.result; const exifObj = piexif.load(imageUrl); + console.log({ + caller: 'ImportSingleFile / Jpeg', + file, + type: file.type, + result: reader.result, + exifObj, + }); const id = exifObj.Exif[piexif.ExifIFD.ImageUniqueID]; const gps = getGps(exifObj); const date = getDate(exifObj); diff --git a/src/lib/exif.ts b/src/lib/exif.ts index 50e0519..a1b7469 100644 --- a/src/lib/exif.ts +++ b/src/lib/exif.ts @@ -21,6 +21,8 @@ export const getGps = (exifObj: any) => { return { latitude: toNumber(1), longitude: toNumber(3), - elevation: exifObj.GPS[6][0] / exifObj.GPS[6][1], + elevation: exifObj.GPS[6] + ? exifObj.GPS[6][0] / exifObj.GPS[6][1] + : undefined, }; };