5 ms·
This really feels like the wrong approach to me - like this will lead to "best viewed with iPhone 5" pages. Whilst there will be ways to automate the setting o
by pbhjpbhj 15y ago
This really feels like the wrong approach to me - like this will lead to "best viewed with iPhone 5" pages.
Whilst there will be ways to automate the setting of such img srcset attributes based on the device (eg the PHP method mentioned that relies on a cookie) this sort of tailoring for specific device [characteristics] seems wrong somehow.
IMO this would be better handled by devices declaring their preferred viewport and/or pixel density just as they declare language preferences now, ie browser headers. Then the server can be set to send different images based on the header values and we don't have to worry about having a massive "srcset" attribute on each image tailoring to 500 different device variants. A server config would specify what viewport ranges to use and tell the server how to modify the images sent (or modify the path, or modify the location - eg switch an image with a folder called image.jpg and have filename tagged images for the different variants handled).
Perhaps this seems hacky too ...
In any case the SRCSET attribute proposal here looks short-sighted and hackish to me.
- deleted 15y ago[deleted]
- WiseWeasel 15y agoYeah, the srcset for every device type on every single image seems excessive. I was hoping we could take advantage of file naming conventions and define a way for user agents to request 'filename' + 'variant key' + 'filename extension' instead of the 'filename.extension' file in the src attribute when it wants non-1x images, where 'variant key' is something like "_2x" added to the filename for 2x images. Then you could just flag img tags as having 2x available boolean. I don't think whatwg likes the idea of file names as metadata, though.