3 ms·
Gross. Srcset is definitely not the solution here. Hacky, stupid, doesn't address the real problem. The real problem is that images only map to files in the mos
by jschrf 13y ago
Gross. Srcset is definitely not the solution here. Hacky, stupid, doesn't address the real problem. The real problem is that images only map to files in the most simple, rigid way.
The solution is to decouple images from URLs and to provide some client-side mechanism to resolve them based on an ID or name of sorts.
Instead of using static URIs, we should be providing resource names and allowing clients to resolve them based on their needs.
Instead of <img src="rock.png" />, we should be doing something more like <img name="rock" /> and allowing clients to decide how to resolve that. It may be a URI string, a data URI, a Blob, a canvas, etc.
The problem isn't low-res or hi-res. It's about how to serve particular images. There are a multitude of factors involved, and a multitude of ways to satisfy an image request.
It's not just about DPI, it's about bandwidth, request count, spritesheets, network conditions, and responsive HTML templates.
srcset is an ugly hack. A tiny DSL within an attribute value that only attempts to address DPI.
Everything else in HTML is more-or-less responsive - why aren't images?