Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

376
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda