Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#31054 closed feature request (maybelater)

Rework Media for Responsive Images

Reported by: jhned's profile jhned Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.2
Component: Media Keywords:
Focuses: Cc:


I've been working on a responsive images plugin for WordPress since Blink implemented the srcset and sizes attributes. However, a colleague of mine remarked that it wouldn't be much use to work independently, since WordPress will eventually come up with a solution for responsive images. So, I'd like to gauge interest for this feature, and be involved in its development. Here are a few of my thoughts to get started:

For a start, I thought we could use the intermediate image sizes to fill out the srcset attribute of an image, and set sizes as an option in the Media Settings.

However, it became clear that it's probably not best to include any image size in the srcset attribute by default, but rather only images that match the aspect ratio.

Of course, a user may want an image to be rectangular on desktop and square on mobile, so maybe it would be better if we gave users a way to define image groups: each group uses a collection of image sizes for the srcset attribute, and has a custom sizes attribute defined. So, when a user goes to insert an image, instead of choosing a specific image size, they pick an image group.

So, my proposal is that we:

  1. Create a method for users to define image groups on the Media Settings page
  2. Use the image group sizes when inserting an image into the Editor, when setting the Post Thumbnail, etc.
  3. When you update the settings for an image group, all img tags using that image group would need to be updated. This part will be intensive from a PHP/time standpoint, depending on how many images have been embedded across the site.

Change History (2)

#1 @helen
8 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to maybelater
  • Status changed from new to closed

A RICG-backed plugin is in development and is now at its initial release: There is also a Slack channel for those interested at #feature-respimg. Let's keep development there, and come back to this ticket when we are at the point of merge.

This ticket was mentioned in Slack in #feature-respimg by helen. View the logs.

8 years ago

Note: See TracTickets for help on using tickets.