Estoy tratando de generar imágenes usando la codificación en el código de Visual Studio. Quiero agregar un tamaño específico para cada imagen en cada carpeta. por ejemplo, pongo este código a continuación para mostrarte lo que quiero decir. el código que escribí a continuación, por ejemplo, está tomando la imagen Cigar.png de la carpeta 6 bocas y especificando su tamaño y posición, lo mismo para otros códigos.
{ id: 0, name: "Cigar", path: `${dir}/6-mouth/Cigar.png`, weight: 46, position: { x: 331, y: 254 }, size: { width: 76, height: 115 }, }, { id: 1, name: "Cigarette", path: `${dir}/6-mouth/Cigarette.png`, weight: 45, position: { x: 346, y: 326 }, size: { width: 80, height: 24 }, }, { id: 2, name: "Gum", path: `${dir}/6-mouth/Gum.png`, weight: 44, position: { x: 352, y: 274 }, size: { width: 139, height: 115 }, }, { id: 3, name: "Pipe", path: `${dir}/6-mouth/Pipe.png`, weight: 43, position: { x: 346, y: 262 }, size: { width: 100, height: 172 }, }, it show me this after typing node index.js in terminal. // C:\Users\RobotiC\Desktop\index.js:80 // _element.layer.position.x, // TypeError: Cannot read properties of undefined (reading 'x') // at drawElement (C:\Users\RobotiC\Desktop\index.js:80:29) // at C:\Users\RobotiC\Desktop\index.js:161:11 // at Array.forEach (<anonymous>) // at C:\Users\RobotiC\Desktop\\index.js:160:22 // at async startCreating (C:\Users\RobotiC\Desktop\index.js:157:7) // Node.js v17.7.2 // how can i fix it // Thanks