This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 20174 - Lacks way to support different image types
Summary: Lacks way to support different image types
Status: RESOLVED NEEDSINFO
Alias: None
Product: HTML WG
Classification: Unclassified
Component: The srcset attribute (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Edward O'Connor
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 20214
  Show dependency treegraph
 
Reported: 2012-11-30 15:17 UTC by Marcos Caceres
Modified: 2012-12-05 21:12 UTC (History)
4 users (show)

See Also:


Attachments

Description Marcos Caceres 2012-11-30 15:17:02 UTC
The img@srcset spec currently lacks a way for alternative image formats to be supported. This means that content negotiation must be done on the server, which is known to be problematic ( see: http://lists.w3.org/Archives/Public/public-html-bugzilla/2011Nov/0309.html ). Or it must be done on the client using a whole bunch of nasty hacks (e.g., downloading a 1x1 pixel image, seeing if it's supported, etc.).
Comment 1 Edward O'Connor 2012-12-05 21:09:20 UTC
What's the use case? <img srcset> matches <img src> here.
Comment 2 Marcos Caceres 2012-12-05 21:12:00 UTC
from [1]:

Some images are best suited to a specific file type for reasons such as file size optimization, alpha transparency, scalability, animation, etc. For example, a photo usually requires good color depth, but does not require alpha transparency or animation; JPEG or WebP are well-suited to these needs and offer good optimization between image quality and file size. Icons are often simpler in terms of color depth, but may require alpha transparency; the PNG format is better-suited to these needs.

Sharing URLs for formats that are not interoperable across browsers is a problem in the wild. See issue 11.

In a responsive design, images need to be displayed at different sizes. When possible, a vector format such as SVG might be most appropriate. There have also been proposals for new responsive image formats (see, for example, Christopher Schmitt's .net article).

Although a web developer may want to use a specific image format, new or otherwise, the browser may not always support it. Currently, developers are forced to abandon the most suitable image format in favor of one that has good user agent support.

[1] http://usecases.responsiveimages.org/#image-formats