Re:Show HN: Instant search of 200K+ SVG logos from 100 sources
by whoisjuan on Sunday June 14, 2020 @04:07PM
(#23520862)
In theory you should be able to get the natural height and width of the image before loading it. Not exactly sure if it works with SVGs but it does work with PNGs
Re:Show HN: Instant search of 200K+ SVG logos from 100 sources
by EmilStenstrom on Sunday June 14, 2020 @04:09PM
(#23520882)
Yeah, you could get the size of the images at indexing time, and return that in the search result.
Re:Show HN: Instant search of 200K+ SVG logos from 100 sources
by Fileformat on Sunday June 14, 2020 @04:20PM
(#23520976)
You are assuming that I actually load the image at index time: I'm really only indexing the file name.
And getting the width/height of a minimized SVG requires rendering it (or at least more SVG mojo than I possess).
Re:Show HN: Instant search of 200K+ SVG logos from 100 sources
by setr on Sunday June 14, 2020 @06:58PM
(#23522141)
He's suggesting your index store the filename, height & width, and retrieve all 3 on search
Re:Show HN: Instant search of 200K+ SVG logos from 100 sources
by Ayesh on Monday June 15, 2020 @02:32AM
(#23524399)
You can use preconneft tags to make the browser preconneft to the likely source of the images. This usually gives a pretty big boost in speed because browsers will have already connected (DNS + TLS handshake) to the icon source's CDN.
I only force the height for the logos, not the width, so wrapping doesn't really improve things.
Waiting to display until they are all loaded kills the "instant" tagline. I'm hotlinking the images, so some images can take awhile.