[wp-trac] [WordPress Trac] #56288: Add mime output control to `add_image_size`

WordPress Trac noreply at wordpress.org
Tue Jul 26 22:14:26 UTC 2022


#56288: Add mime output control to `add_image_size`
------------------------------------+---------------------
 Reporter:  adamsilverstein         |       Owner:  (none)
     Type:  enhancement             |      Status:  new
 Priority:  normal                  |   Milestone:  6.1
Component:  Media                   |     Version:
 Severity:  normal                  |  Resolution:
 Keywords:  dev-feedback has-patch  |     Focuses:
------------------------------------+---------------------
Changes (by adamsilverstein):

 * keywords:  dev-feedback needs-patch => dev-feedback has-patch


Old description:

> ## Summary
> * Add an option to the `add_image_size` function so that developers can
> control whether secondary mime types are generated for the image size
> they are adding.
>
> ## Description
> In https://core.trac.wordpress.org/ticket/55443 we introduced multi-mime
> support and the capability to generate sub-sizes in secondary mime types
> (or even to replace the primary output mime). The code includes a filter
> that enables developer control over which sizes output secondary mimes.
> This ticket aims to extend that work by adding control over secondary
> mime generation per size at the point of registration.
>
> ## Considerations
> This initial proposal is to add a new "output_mimes" boolean parameter to
> the `add_image_size` function. I also considered instead adding an
> `$output_options` (keyed) array parameter, this would then have an option
> for `output_mimes` and in the future we could use this to enable a
> quality setting per size which we have discussed elsewhere already.
>
> I decided to keep this PR simple by using a boolean vs an array because
> that is all we need now. I would appreciate feedback on this approach.

New description:

 = Summary =
 * Add an option to the `add_image_size` function so that developers can
 control whether secondary mime types are generated for the image size they
 are adding.

 = Description =
 In https://core.trac.wordpress.org/ticket/55443 we introduced multi-mime
 support and the capability to generate sub-sizes in secondary mime types
 (or even to replace the primary output mime). The code includes a filter
 that enables developer control over which sizes output secondary mimes.
 This ticket aims to extend that work by adding control over secondary mime
 generation per size at the point of registration.

 = Considerations =
 This initial proposal is to add a new "output_mimes" boolean parameter to
 the `add_image_size` function. I also considered instead adding an
 `$output_options` (keyed) array parameter, this would then have an option
 for `output_mimes` and in the future we could use this to enable a quality
 setting per size which we have discussed elsewhere already.

 I decided to keep this PR simple by using a boolean vs an array because
 that is all we need now. I would appreciate feedback on this approach.

--

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56288#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list