Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

121
Views
Trying to add specific size for each image in the folder in config.js

Im trying to generate images using coding in visual studio code. I want to add specific size for each image in each folder. for example I put this code below to show you what i mean. the code that I wrote below for example is taking the image Cigar.png from the folder 6-mouth and specifying its size and position, the same for other codes.

      {
        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
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!