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

157
Views
la función de devolución de llamada da un error al usar el evento de carga interna

cómo usar la función de devolución de llamada para usar el valor devuelto porque cuando inicio sesión en la consola con croppedBase64Img me da indefinido, necesito obtener el valor de croppedBase64Img

 croppedBase64Img = await base64SquareCrop(base64Image, function(result){ return result; }); async function base64SquareCrop(imgbase64, size = 224, callback) { const img = document.createElement("img"); await img.setAttribute("src", imgbase64); let width = 1240; let height = 698; const min = Math.min(width, height); const scale = size / min; const scaledW = Math.ceil(width * scale); const scaledH = Math.ceil(height * scale); const dx = scaledW - size; const dy = scaledH - size; canvasImage.width = canvasImage.height = size; const ctx_img = canvasImage.getContext("2d"); img.onload = function() { ctx_img.drawImage( img, ~~(dx / 2) * -1, ~~(dy / 2) * -1, scaledW, scaledH ); callback(canvasImage.toDataURL("image/png")); }
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!