mirror of
https://github.com/osmarks/meme-search-engine.git
synced 2026-09-18 23:30:47 +00:00
File metadata storage.
The backend now knows how big images are, so the frontend can size images correctly before they're loaded. This should significantly improve the UI on slow connections. Also fix bug where videos weren't erased from the index properly.
This commit is contained in:
@@ -137,7 +137,7 @@
|
||||
<Masonry bind:refreshLayout={refreshLayout} colWidth="minmax(Min(20em, 100%), 1fr)" items={displayedResults}>
|
||||
{#each displayedResults as result}
|
||||
{#key `${queryCounter}${result.file}`}
|
||||
<div class="result">
|
||||
<div class="result" style={aspectRatio(result)}>
|
||||
<a href={util.getURL(result)}>
|
||||
{#if util.hasFormat(results, result, "VIDEO")}
|
||||
<video controls poster={util.hasFormat(results, result, "jpegh") ? util.thumbnailURL(results, result, "jpegh") : null} preload="metadata" on:loadstart={updateCounter} on:loadedmetadata={redrawGrid} on:loadeddata={redrawGrid}>
|
||||
@@ -198,6 +198,8 @@
|
||||
return `${snd}/${fst}`
|
||||
}
|
||||
|
||||
const aspectRatio = result => result[4] ? `aspect-ratio: ${result[4][0]}/${result[4][1]}` : null
|
||||
|
||||
const decodeFloat16 = uint16 => {
|
||||
const sign = (uint16 & 0x8000) ? -1 : 1
|
||||
const exponent = (uint16 & 0x7C00) >> 10
|
||||
|
||||
Reference in New Issue
Block a user