Image
element with src
being the URL of the image file. For local files, we can get url out of File
object. For Dropbox and S3 we need to create a temporary, publicly visible URL It only works for image types natively supported by browsers. Luckily, browsers support most popular image format. In the future might add support for more images via conversion.foo9.txt
show up before foo10.txt
. Unfortunately sorting by characters doesn’t do that because 1
is before 9
. So called “natural” sorting does the right thing. Turns out it was very simple to implement: a.localeCompare(b, navigator.languages[0] || navigator.language, {numeric: true, ignorePunctuation: true})