HEIC to JPG Converter

📁

Drag & Drop HEIC files here

or

Conversion Settings

Note: Conversion happens in your browser. Your images are not uploaded to any server.

Converted ${convertedFiles.length} file(s)

Total size before: ${formatFileSize(totalOriginalSize)}

Total size after: ${formatFileSize(totalConvertedSize)}

Size reduction: ${reductionPercent}%

`; } // Download functions downloadAllBtn.addEventListener('click', () => { for (const file of convertedFiles) { downloadFile(file.blob, file.name); } }); function downloadFile(blob, filename) { const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = filename; document.body.appendChild(a); a.click(); setTimeout(() => { document.body.removeChild(a); URL.revokeObjectURL(url); }, 100); } // PDF generation pdfBtn.addEventListener('click', async () => { if (typeof jsPDF === 'undefined') { try { await loadScript('https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js'); } catch (error) { alert('Failed to load PDF library. Please try again.'); return; } } const { jsPDF } = window.jspdf; const doc = new jsPDF(); doc.setFontSize(18); doc.text('HEIC to JPG Conversion Summary', 15, 20); doc.setFontSize(12); let yPos = 40; doc.text(`Total Files Converted: ${convertedFiles.length}`, 15, yPos); yPos += 10; const totalOriginalSize = convertedFiles.reduce((sum, file) => sum + file.originalSize, 0); const totalConvertedSize = convertedFiles.reduce((sum, file) => sum + file.convertedSize, 0); const reductionPercent = ((totalOriginalSize - totalConvertedSize) / totalOriginalSize * 100).toFixed(2); doc.text(`Original Total Size: ${formatFileSize(totalOriginalSize)}`, 15, yPos); yPos += 10; doc.text(`Converted Total Size: ${formatFileSize(totalConvertedSize)}`, 15, yPos); yPos += 10; doc.text(`Size Reduction: ${reductionPercent}%`, 15, yPos); yPos += 20; doc.text('Converted Files:', 15, yPos); yPos += 10; for (const file of convertedFiles) { if (yPos > 250) { doc.addPage(); yPos = 20; } doc.text(`${file.name}: ${formatFileSize(file.originalSize)} → ${formatFileSize(file.convertedSize)}`, 15, yPos); yPos += 10; } doc.save('HEIC_to_JPG_Conversion_Summary.pdf'); }); });
Scroll to Top