EXIF Data Reader
Read and display EXIF metadata (orientation, dimensions, camera, date) from JPEG files.
(function() {
var logEl = document.getElementById('log');
function log(m) { var d = document.createElement('div'); d.className='pkg-log-entry'; d.textContent=m; logEl.appendChild(d); logEl.scrollTop=logEl.scrollHeight; }
new MultipleUpload('#demo', {
uploadUrl: '/api/upload',
multiple: true,
accept: 'image/jpeg',
autoUpload: false,
onSelect: function(files) {
files.forEach(function(file) {
MultipleUpload.readExifData(file).then(function(exif) {
if (exif) {
log(file.name + ' EXIF:');
if (exif.orientation) log(' Orientation: ' + exif.orientation);
if (exif.width) log(' Width: ' + exif.width);
if (exif.height) log(' Height: ' + exif.height);
if (exif.make) log(' Make: ' + exif.make);
if (exif.model) log(' Model: ' + exif.model);
if (exif.dateTimeOriginal) log(' Date: ' + exif.dateTimeOriginal);
} else {
log(file.name + ': no EXIF data');
}
});
});
}
});
})();Reading metadata before upload
EXIF data is available in the browser, so you can show the capture date, camera, or orientation while the file is still in the queue — useful for letting the user confirm they picked the right photo before committing to the transfer.
It is also a privacy decision
Photos routinely carry GPS coordinates, device serial numbers and timestamps. If the uploaded file will be visible to anyone else, decide deliberately whether that metadata should travel with it. Re-encoding through the image pipeline drops most of it as a side effect, which is convenient but worth doing on purpose rather than relying on.