Skip to content

Commit

Permalink
Merge pull request #9 from wu-mx/master
Browse files Browse the repository at this point in the history
Catch遍历图片时的图片大小获取error
  • Loading branch information
Edge-coordinates authored Feb 9, 2024
2 parents 5ce296b + 4300d13 commit c78624d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src-electron/traverseFolder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ function traverseFolderObjects (currentPath) {
srcThumb: 'atom://' + filePath
});
picMetaMap.set(filePath, picLinks.length - 1);
const dimensions = sizeOf(filePath);
// console.log(dimensions.width, dimensions.height);
// console.log(filePath);
picLinks[picMetaMap.get(filePath)].height = dimensions.height;
picLinks[picMetaMap.get(filePath)].width = dimensions.width;
try{
const dimensions = sizeOf(filePath);
picLinks[picMetaMap.get(filePath)].height = dimensions.height;
picLinks[picMetaMap.get(filePath)].width = dimensions.width;
}catch (err) {}
// console.log(picLinks[picMetaMap.get(filePath)]);

// 异步方案,有问题
Expand Down

0 comments on commit c78624d

Please sign in to comment.