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

375
Views
Pica: cannot use getImageData on canvas, make sure fingerprinting protection isn't enabled

I am getting this error while using npm pica library. I want to resize image using this library. Have tried two ways I. by passing image url directly to pica.resize(imageurl, canvas) and II. by passing image buffer to pica.resize(imageBuffer,canvas). But it shows error Pica: cannot use getImageData on canvas, make sure fingerprinting protection isn't enabled. when I run code.

// Convert Base64 to BufferArray
    const buf = Buffer.from(img, 'base64');

    let binary = '';
    const chunk = 8 * 1024;
    let i;
    for (i = 0; i < buf.length / chunk; i += 1) {
      binary += String.fromCharCode.apply(null, [
        ...buf.slice(i * chunk, (i + 1) * chunk),
      ]);
    }
    binary += String.fromCharCode.apply(null, [...buf.slice(i * chunk)]);

    // Dimensions for the image
    const width = 1200;
    const height = 627;

    // Instantiate the canvas object
    const can = canvas.createCanvas(width,height);
    // const context = canvas.getContext("2d");
    console.log(binary)
    
    pica.resize(binary, can)
        .then(result => console.log(result));

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!