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

176
Views
JSZip: las imágenes comprimidas están corruptas

Estoy tratando de comprimir algún tipo de imágenes.

 const handleZip = async (e) => { e.preventDefault(); const zip = new JSZip(); const folder = zip.folder(storeName); for (let i = 0; i < QRCodes.length; i++) { folder.file(`${i + 1}.jpg`, QRCodes[i]); } zip.generateAsync({ type: "blob" }).then((content) => { FileSaver.saveAs(content, `${storeName}.zip`); });

};

El resultado es StoreName.zip>StoreNameFolder>20 imágenes en formato jpg

y estas imágenes no funcionan, está corrupto. También intenté cambiar los datos de la imagen con una URL de imagen en Internet, pero el resultado fue el mismo.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

He resuelto el problema con esto;

 const base64String = QRCodes[i].replace("data:", "").replace(/^.+,/, ""); folder.file(`${i + 1}.png`, base64String, { base64: true });
about 4 years ago · Juan Pablo Isaza Report
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!