[wp-trac] [WordPress Trac] #32459: Add a filter for overriding image sizes before uploading

WordPress Trac noreply at wordpress.org
Thu May 21 18:53:14 UTC 2015


#32459: Add a filter for overriding image sizes before uploading
----------------------------+-----------------------------
 Reporter:  danphilibin     |      Owner:
     Type:  enhancement     |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Media           |    Version:  4.2.2
 Severity:  normal          |   Keywords:
  Focuses:  administration  |
----------------------------+-----------------------------
 As WordPress has evolved into a very powerful CMS, responsive layouts and
 high-resolution screens are growing more and more common. It's not
 uncommon for large sites to register several additional image sizes, and
 adding 2X support doubles the number of images created behind the scenes.

 It would be nice for plugins to be able to have more granular control over
 the sizes that are created when an image is uploaded.

 An example: a company Team page features portraits for each employee. Only
 two sizes are needed: 250x250 and 500x500 (2x). Meanwhile, the rest of the
 site has nearly a dozen custom image sizes. When the portraits are
 uploaded, a dozen sizes are created, but only two are needed. Similarly,
 registering these two new sizes registers them for every image uploaded to
 the site.

 In a plugin like Advanced Custom Fields, I'd like to be able to tell the
 uploader to skip all of the built-in sizes and hand-pick the sizes I do
 want to create.

 In other words, a new set of sizes would need to be registered that aren't
 automatically included in the global set of image sizes, but are available
 for plugins to select and send to the uploader. The uploader could be
 given a special set of sizes when it's opened, and those special sizes can
 be fetched from the theme.

 To be clear, I'm not talking about generating new image sizes when the
 theme requests them. This request is for overriding the sizes that the
 uploader applies to a new image.

 I've explored the built-in functions and hooks and filters, but it doesn't
 appear there's a way to override the sizes that are created in the way I
 describe.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/32459>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list