Hacker News new | ask | show | jobs
by michaelmior 5141 days ago
No file format exists which supports this use case.
4 comments

We switched slightly midstream and we are now talking about an "entirely server side solution", if you scan back a few posts up. It's fairly trivial to do image processing on a server and cache the results based on the URL
I wasn't aware that you could specify completely different images at different resolutions.
i wonder if you could do it with separate frames of a GIF? there's no reason they have to be played as an animation. (they don't even have to be the same size as each other or the logical screen, afaict.)
I don't see how the client could selectively download frames. GIF isn't really the nicest file format anyway.
can you fetch arbitrary byte ranges over http? i don't know the details of the GIF chunk format, but often there's a header or something that you could use to calculate what other part of the file you want.

(yes, this is almost certainly a terrible way to implement it, but i was curious as to whether it could be shoehorned in.)

You can, but this is server dependent and not possible with the GIF format. If you were to construct a format where this is possible, this would mean a minimum of two HTTP requests and quite possible three since the header would have to be of variable length.

Additionally, trying to get browsers to consistently implement something of this level of complexity sounds dangerous.

Jpeg does.