Перейти к основному содержимому
clawam tools
Инструменты Документы Daoark EN Главная Главная / Инструменты для изображений›= 1) return t + 's'; return '1/' + Math.round(1/t) + 's'; } function dmsToDec(dms, ref) { var d = dms[0], m = dms[1], s = dms[2]; var dec = d + m/60 + s/3600; if (ref === 'S' || ref === 'W') dec = -dec; return dec; } form.addEventListener('submit', function(e) { e.preventDefault(); clearError(); clearResult(); var file = document.getElementById('file').files[0]; if (!file) { showError('请先选择图片'); return; } var showGps = document.getElementById('showGps').checked; btnMain.disabled = true; var orig = btnMain.textContent; btnMain.textContent = '读取中…'; var reader = new FileReader(); reader.onload = function(ev) { try { var buf = new Uint8Array(ev.target.result); var exif = parseExif(buf); var resultContent = document.getElementById('result-content'); var resultMeta = document.getElementById('result-meta'); if (!exif) { resultContent.textContent = '未检测到 EXIF 数据 (图片可能不包含拍摄参数,或格式不受支持)'; resultMeta.textContent = '文件: ' + file.name + ' (' + file.type + ', ' + file.size + ' 字节)'; } else { var lines = []; if (exif.Make) lines.push('[X] 相机品牌: ' + exif.Make); if (exif.Model) lines.push('[X] 相机型号: ' + exif.Model); if (exif.LensModel) lines.push('[X] 镜头: ' + exif.LensModel); if (exif.DateTimeOriginal) lines.push('[X] 拍摄时间: ' + exif.DateTimeOriginal); if (exif.FNumber) lines.push('[X] 光圈: f/' + exif.FNumber); if (exif.ExposureTime) lines.push('⏱ 快门: ' + formatExposure(exif.ExposureTime)); if (exif.ISOSpeedRatings) lines.push('[X] ISO: ' + exif.ISOSpeedRatings); if (exif.FocalLength) lines.push('[X] 焦距: ' + exif.FocalLength + 'mm'); if (exif.Software) lines.push('[X] 软件: ' + exif.Software); if (showGps && exif.GPS) { if (exif.GPS.GPSLatitude) { var lat = dmsToDec(exif.GPS.GPSLatitude, exif.GPS.GPSLatitudeRef); var lon = dmsToDec(exif.GPS.GPSLongitude, exif.GPS.GPSLongitudeRef); lines.push('[X] GPS: ' + lat.toFixed(6) + ', ' + lon.toFixed(6)); } } if (lines.length === 0) lines.push('(EXIF 存在但无可显示字段)'); resultContent.textContent = lines.join('\n'); resultMeta.textContent = 'EXIF 解析完成 (' + Object.keys(exif).length + ' 字段, ' + file.size + ' 字节)'; } resultArea.classList.add('show'); } catch(err) { showError('解析失败: ' + err.message); } btnMain.disabled = false; btnMain.textContent = orig; }; reader.onerror = function() { showError('文件读取失败'); btnMain.disabled = false; btnMain.textContent = orig; }; reader.readAsArrayBuffer(file); }); btnClear.addEventListener('click', function() { form.reset(); clearError(); clearResult(); }); })();
clawam tools

clawam.com · Agent JSON API · built by Daoark

Navegação

Инструменты Документы Daoark

Machine Readable

sitemap.xml robots.txt

苏ICP备2025187298号-28 · clawam.com · built by Daoark