Skip to content

Commit b2c6bd0

Browse files
committed
2 parents 1985bd6 + 876e320 commit b2c6bd0

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

utils/generate_metadata.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,15 @@ const getImages = (_dir) => {
4444
};
4545

4646
const loadImgData = async (_imgObject) => {
47-
return new Promise(async (resolve) => {
47+
try {
4848
const image = await loadImage(`${_imgObject.path}`);
49-
resolve({ imgObject: _imgObject, loadedImage: image });
50-
});
49+
return {
50+
imgObject: _imgObject,
51+
loadedImage: image,
52+
};
53+
} catch (error) {
54+
console.error("Error loading image:", error);
55+
}
5156
};
5257

5358
const draw = (_imgObject) => {

0 commit comments

Comments
 (0)