MCPcopy
hub / github.com/HashLips/hashlips_art_engine / getImages

Function getImages

utils/pixelate.js:19–38  ·  view source on GitHub ↗
(_dir)

Source from the content-addressed store, hash-verified

17};
18
19const getImages = (_dir) => {
20 try {
21 return fs
22 .readdirSync(_dir)
23 .filter((item) => {
24 let extension = path.extname(`${_dir}${item}`);
25 if (extension == ".png" || extension == ".jpg") {
26 return item;
27 }
28 })
29 .map((i) => {
30 return {
31 filename: i,
32 path: `${_dir}/${i}`,
33 };
34 });
35 } catch {
36 return null;
37 }
38};
39
40const loadImgData = async (_imgObject) => {
41 try {

Callers 1

startCreatingFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected