(no title)
wonderlg | 5 years ago
It’s 2020 and its mind-boggling that this isn’t a standard behavior already.
Imagine right-clicking on a thumbnail and being able to natively save a 4MB file from it.
Imagine having a single <img> that can be zoomed in all the way to 100% just like your phone’s Photos app can do, without loading the whole image beforehand.
bscphil|5 years ago
The issue with doing this is not with the basic idea, obviously it would be desirable if we could do it, but with the fact that it's actually much less efficient to encode the entire file this way if you want real progressive loading (i.e. stop at any point). It's much more reasonable at present to just dynamically load a reasonably sized image for the current viewport, even before you get to issues like format support.
[1] https://flif.info
SahAssar|5 years ago
This is basically a solved problem when people use mime types properly for formats. For sizes we'd need a similar way to mime types to ask for a size, html solves this for images with srcset but I'd rather it be within the transport mechanism rather than in the markup.
Requesting an image should be requesting a image, not a specific representation of that image. The representation should be part of the content negotiation that is already a part of the protocol.
wonderlg|5 years ago
> Requesting an image should be requesting a image, not a specific representation of that image.
This is exactly what I’m saying. The image is one, it’s the browser that decides how much of it to load.
It’s the current picture/srcset-based situation that is “a specific representation of that image”
> For sizes we'd need a similar way to mime types to ask for a size
Now that is complicating things. Suddenly the server has to produce/return different resources based on a header. The solution I described could be delivered by any dumb HTTP2 server, without preprocessing.
Technically what I’m describing is already possible with any progressive format like JPEG; The only missing part is that the browser should pause/resume the loading as it sees fit.
All I want for Christmas is:
The obvious advantage is that if the window size changes, the browser only has to fetch the missing data, not a whole new file.Traster|5 years ago