feat: add exif data to image tags
Some checks failed
Deploy to SFTP Server / build (push) Failing after 1m34s
Some checks failed
Deploy to SFTP Server / build (push) Failing after 1m34s
This commit is contained in:
@@ -150,6 +150,7 @@
|
||||
try {
|
||||
let rawExif = image.getAttribute("data-exif");
|
||||
exif = JSON.parse(rawExif);
|
||||
console.log(exif);
|
||||
} catch (error) {
|
||||
// No biggie
|
||||
}
|
||||
@@ -187,8 +188,7 @@
|
||||
class:active={currentIndex === i}
|
||||
on:click={() => {
|
||||
currentIndex = i;
|
||||
}}
|
||||
/>
|
||||
}} />
|
||||
{/each}
|
||||
</div>
|
||||
{/if}
|
||||
@@ -204,21 +204,18 @@
|
||||
on:swipe={handleSwipe}
|
||||
on:wheel|passive={handleScroll}
|
||||
on:mousemove={handleMouseMove}
|
||||
on:pointermove={handlePointerMove}
|
||||
>
|
||||
on:pointermove={handlePointerMove}>
|
||||
{#if progress[currentIndex] && progress[currentIndex] < 0.99}
|
||||
<div
|
||||
transition:fade
|
||||
id="progress"
|
||||
style={`transform: scaleX(${progress[currentIndex]});`}
|
||||
/>
|
||||
style={`transform: scaleX(${progress[currentIndex]});`} />
|
||||
{/if}
|
||||
|
||||
<img
|
||||
class="background"
|
||||
src={images[currentIndex].preview}
|
||||
alt="background blur"
|
||||
/>
|
||||
alt="background blur" />
|
||||
|
||||
<span>
|
||||
<img
|
||||
@@ -227,15 +224,14 @@
|
||||
}px ${window.innerHeight - my}px`}
|
||||
srcset={images[currentIndex].loaded ? "" : images[currentIndex].src}
|
||||
src={images[currentIndex].loaded}
|
||||
alt={images[currentIndex].alt}
|
||||
/>
|
||||
alt={images[currentIndex].alt} />
|
||||
</span>
|
||||
</div>
|
||||
{#if images[currentIndex].exif}
|
||||
{@const exif = images[currentIndex].exif}
|
||||
<div class="exif" on:click={() => console.log(exif)}>
|
||||
{#if "FocalLength" in exif}
|
||||
{exif.FocalLength}mm |
|
||||
{exif.FocalLength} |
|
||||
{/if}
|
||||
|
||||
{#if "FNumber" in exif}
|
||||
|
Reference in New Issue
Block a user