Hacker News new | ask | show | jobs
by hoppipolla 5143 days ago
That is a very appealing design, but sadly it doesn't address all the use cases. In particular one thing that people want to be able to do is to display a different image depending on the viewport dimensions, for example a closer crop on a small screen compared to that shown on a larger screen.
1 comments

what is stopping this approach from addressing that use case?
No file format exists which supports this use case.
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.