From e395ff4aa62c9667a0cc6c9573c28e5b16c3bf25 Mon Sep 17 00:00:00 2001 From: Chuck Dries Date: Fri, 18 Jun 2021 20:37:01 -0700 Subject: [PATCH] Improve metadata icons and add location --- src/components/GalleryImage.js | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/src/components/GalleryImage.js b/src/components/GalleryImage.js index 9a7dd2f..72123d9 100644 --- a/src/components/GalleryImage.js +++ b/src/components/GalleryImage.js @@ -21,6 +21,11 @@ const GalleryImage = ({ data }) => { const name = getName(image); const meta = getMeta(image); + let locationString; + if (meta.iptc.city || meta.iptc.province_or_state) { + const location = [meta.iptc.city, meta.iptc.province_or_state].filter(Boolean); + locationString = location.join(', '); + } const vibrant = getVibrant(image, true); const orientationClasses = ar > 1 ? 'flex-col mx-auto' : 'portrait:mx-auto landscape:mx-5 landscape:flex-row-reverse portrait:flex-col'; @@ -56,17 +61,26 @@ const GalleryImage = ({ data }) => { {hasName(image) &&

{name}

}

{meta.iptc.caption}

- {shutterSpeed &&
- {shutterSpeed} - -
} - {meta.exif.FNumber &&
- f/{meta.exif.FNumber} - - + {(locationString) &&
+ + + {locationString} +
} + {shutterSpeed &&
+ + {shutterSpeed} +
} + {meta.exif.FNumber &&
+ + + + f/{meta.exif.FNumber} +
} + {meta.exif.ISO &&
+ ISO + {meta.exif.ISO}
} - {meta.exif.ISO &&
{meta.exif.ISO}ISO
}
@@ -97,6 +111,8 @@ export const query = graphql` caption object_name keywords + city + province_or_state } exif { FNumber