From c976b9f7f4a825fc138a3ff804fab831d0d9ff68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=E2=84=93e=20Hensel?= Date: Thu, 7 Dec 2023 00:08:13 +1300 Subject: [PATCH] show date/time for georeferenced photos (#9990) --- css/60_photos.css | 4 ++++ modules/svg/local_photos.js | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/css/60_photos.css b/css/60_photos.css index f1ab020d4..0a58871ea 100644 --- a/css/60_photos.css +++ b/css/60_photos.css @@ -85,6 +85,10 @@ padding: 4px 2px; z-index: 10; } +.photo-attribution-dual { + display: flex; + justify-content: space-between; +} .photo-attribution a, .photo-attribution a:visited, diff --git a/modules/svg/local_photos.js b/modules/svg/local_photos.js index 181985c06..597c9e2dd 100644 --- a/modules/svg/local_photos.js +++ b/modules/svg/local_photos.js @@ -64,7 +64,7 @@ export function svgLocalPhotos(projection, context, dispatch) { viewerEnter .append('div') - .attr('class', 'photo-attribution fillD'); + .attr('class', 'photo-attribution photo-attribution-dual fillD'); return planePhotoFrame.init(context, viewerEnter) .then(planePhotoFrame => { @@ -84,6 +84,11 @@ export function svgLocalPhotos(projection, context, dispatch) { const attribution = viewerWrap.selectAll('.photo-attribution').text(''); + if (image.date) { + attribution + .append('span') + .text(image.date.toLocaleString()); + } if (image.name) { attribution .append('span') @@ -233,7 +238,8 @@ export function svgLocalPhotos(projection, context, dispatch) { getSrc: () => readFileAsDataURL(file), file: file, loc: [exifData.longitude, exifData.latitude], - direction: exifData.GPSImgDirection + direction: exifData.GPSImgDirection, + date: exifData.CreateDate || exifData.DateTimeOriginal || exifData.ModifyDate, }; loaded.push(photo); const sameName = _photos.filter(i => i.name === photo.name);