Skip to content

Commit 1a2fa42

Browse files
committed
Catch exif gpsData error
1 parent cfe927f commit 1a2fa42

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

wallpanel-src.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2754,7 +2754,7 @@ function initWallpanel() {
27542754
continue;
27552755
}
27562756

2757-
const excludedByRegExp = false;
2757+
let excludedByRegExp = false;
27582758
for (const exclude of excludeRegExp) {
27592759
if (exclude.test(asset.originalFileName)) {
27602760
logger.debug(`Media item excluded by regex "${exclude}"`);
@@ -5252,10 +5252,12 @@ function readEXIFData(file, start) {
52525252
if (tags.GPSInfoIFDPointer) {
52535253
gpsData = readTags(file, tiffOffset, tiffOffset + tags.GPSInfoIFDPointer, GPSTags, bigEnd);
52545254
for (tag in gpsData) {
5255-
switch (tag) {
5256-
case "GPSVersionID":
5255+
if (tag == "GPSVersionID") {
5256+
try {
52575257
gpsData[tag] = gpsData[tag][0] + "." + gpsData[tag][1] + "." + gpsData[tag][2] + "." + gpsData[tag][3];
5258-
break;
5258+
} catch {
5259+
// Prevent uncaught error
5260+
}
52595261
}
52605262
tags[tag] = gpsData[tag];
52615263
}

0 commit comments

Comments
 (0)