Add camera and lens metadata to gallery images
This commit is contained in:
parent
984258cf76
commit
8659835897
@ -108,7 +108,10 @@ function transformMetaToNodeData(exifData, iptcData, vibrantData, imagePath) {
|
|||||||
const vibrant = vibrantData ? processColors(vibrantData, imagePath) : null;
|
const vibrant = vibrantData ? processColors(vibrantData, imagePath) : null;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
exif: exifData?.exif,
|
exif: {
|
||||||
|
...exifData?.exif,
|
||||||
|
...exifData?.image
|
||||||
|
},
|
||||||
gps,
|
gps,
|
||||||
dateTaken: exifData?.exif?.DateTimeOriginal,
|
dateTaken: exifData?.exif?.DateTimeOriginal,
|
||||||
iptc: iptcData || undefined,
|
iptc: iptcData || undefined,
|
||||||
|
@ -174,13 +174,28 @@ const GalleryImage = ({ data, pageContext }) => {
|
|||||||
<MetadataItem
|
<MetadataItem
|
||||||
aspectRatio={ar}
|
aspectRatio={ar}
|
||||||
data={locationString}
|
data={locationString}
|
||||||
icon="location-sharp"
|
icon="location"
|
||||||
title="location"
|
title="location"
|
||||||
/>
|
/>
|
||||||
|
{(meta.exif.Make || meta.exif.Model) && <MetadataItem
|
||||||
|
aspectRatio={ar}
|
||||||
|
data={[meta.exif.Make, meta.exif.Model].join(' ')}
|
||||||
|
icon="camera"
|
||||||
|
title="camera"
|
||||||
|
/>}
|
||||||
|
{(meta.exif.LensModel || meta.exif.FocalLength) && <MetadataItem
|
||||||
|
aspectRatio={ar}
|
||||||
|
data={[
|
||||||
|
meta.exif.LensModel === '----' ? null : meta.exif.LensModel,
|
||||||
|
meta.exif.FocalLength && `${meta.exif.FocalLength}mm`
|
||||||
|
].filter(Boolean).join(' @')}
|
||||||
|
icon="ellipse"
|
||||||
|
title="lens"
|
||||||
|
/>}
|
||||||
<MetadataItem
|
<MetadataItem
|
||||||
aspectRatio={ar}
|
aspectRatio={ar}
|
||||||
data={shutterSpeed}
|
data={shutterSpeed}
|
||||||
icon="stopwatch-sharp"
|
icon="stopwatch"
|
||||||
title="shutter speed"
|
title="shutter speed"
|
||||||
/>
|
/>
|
||||||
{meta.exif.FNumber && <MetadataItem
|
{meta.exif.FNumber && <MetadataItem
|
||||||
@ -239,7 +254,11 @@ export const query = graphql`
|
|||||||
exif {
|
exif {
|
||||||
FNumber
|
FNumber
|
||||||
ExposureTime
|
ExposureTime
|
||||||
|
FocalLength
|
||||||
ISO
|
ISO
|
||||||
|
LensModel
|
||||||
|
Make
|
||||||
|
Model
|
||||||
}
|
}
|
||||||
vibrant {
|
vibrant {
|
||||||
...VibrantColors
|
...VibrantColors
|
||||||
|
@ -11,7 +11,7 @@ const MetadataItem = ({ aspectRatio, icon, data, title }) =>
|
|||||||
title={title}
|
title={title}
|
||||||
>
|
>
|
||||||
<span className="icon-offset mr-1">
|
<span className="icon-offset mr-1">
|
||||||
<ion-icon name={icon}></ion-icon>
|
<ion-icon name={icon} title={title}></ion-icon>
|
||||||
</span>
|
</span>
|
||||||
<span className="mr-1">{data}</span>
|
<span className="mr-1">{data}</span>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user