wordpress-develop/tests/phpunit/data
Adam Silverstein 9bbf3985e3 Media: enable generating multiple mime types for image uploads; specifically WebP versions for JPEG images by default.
This changeset adds the capability for core media uploads to generate sub sized images in more than a single mime type. The output formats for each mime type can be controlled through a filter. WebP is used as an additional output format for JPEG images by default to improve front end performance.

When generating additional mime types, only images which are smaller than the respective original are retained. By default, additional mime type images are only generated for the built-in core image sizes and any custom sizes that have opted in.

Image meta is updated with a new 'sources' array containing file details for each mime type. Each image size in the 'sizes' array also gets a new 'sources' array that contains the image file details for each mime type.

This change also increases image upload retries to accommodate additional image sizes. It also adds a `$mime_type` parameter to the `wp_get_missing_image_subsizes` function and filter.

This change adds three new filters to enable full control of secondary mime image generation and output:

* A new filter `wp_image_sizes_with_additional_mime_type_support` that filters the sizes that support secondary mime type output. Developers can use this to control the output of additional mime type sub-sized images on a per size basis.
* A new filter `wp_upload_image_mime_transforms` that filters the output mime types for a given input mime type. Developers can use this to control generation of additional mime types for a given input mime type or even override the original mime type.
* A new filter `wp_content_image_mimes` which controls image mime type output selection and order for frontend content. Developers can use this to control the mime type output preference order for content images. Content images inserted from the media library will use the available image versions based on the order from this filter.

Thanks to the many contributors who helped develop, test and give feedback on this feature.

A haiku to summarize:

Upload a JPEG
Images of all sizes
Output as WebPs

Props flixos90, MatthiasReinholz, studiolxv, markhowellsmead, eatingrules, pbiron, mukesh27, joegrainger, mehulkaklotar, tweetythierry, akshitsethi, peterwilsoncc, eugenemanuilov, mitogh, shetheliving, clarkeemily, codekraft, mikeschroder, clorith, kasparsd, spacedmonkey, trevorpfromsandee, jb510, scofennellgmailcom, seedsca, cagsmith, karinclimber, dainemawer, baxbridge, grapplerulrich, sobatkras, chynnabenton, tonylocalword, barneydavey, kwillmorth, garymatthews919, olliejones, imarkinteractive, jeffpaul, feastdesignco, webbeetle, masteradhoc.

See #55443.



git-svn-id: https://develop.svn.wordpress.org/trunk@53751 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-21 18:01:01 +00:00
..
blocks Editor: Fix register_block_type does not recognise ancestor block setting 2022-07-19 13:22:31 +00:00
export Ensure svn:eol-style is consistently set for all files (part 2). 2019-10-25 19:27:49 +00:00
feed Administration: Replace contracted verb forms for better consistency. 2022-03-22 16:23:32 +00:00
formatting Themes: Make sure get_file_data() recognizes headers prefixed by <?php tag. 2021-06-18 14:02:44 +00:00
functions Tests: Some test improvements for clean_dirsize_cache() tests: 2021-10-26 02:02:50 +00:00
images Media: enable generating multiple mime types for image uploads; specifically WebP versions for JPEG images by default. 2022-07-21 18:01:01 +00:00
languages Fix: Update block-theme-pl_PL.mo file. 2021-11-08 20:32:39 +00:00
plugins I18N: Revert [49236] for now to investigate alternative implementations. 2020-11-12 14:41:19 +00:00
pomo Move PHPUnit tests into a tests/phpunit directory. 2013-08-29 18:39:34 +00:00
templates Editor: Add block theme infrastructure 2021-11-08 23:09:53 +00:00
theme-file-child Themes: Improve child theme file inheritance by introducing functions for locating and fetching the URL or path to files within child and parent themes. 2016-09-08 22:53:57 +00:00
theme-file-parent Themes: Improve child theme file inheritance by introducing functions for locating and fetching the URL or path to files within child and parent themes. 2016-09-08 22:53:57 +00:00
themedir1 Themes: Accept valid block themes. 2022-05-20 00:47:45 +00:00
uploads Ensure svn:eol-style is consistently set for all files (part 2). 2019-10-25 19:27:49 +00:00
widgets Docs: Correct the format of some comments per the documentation standards. 2021-12-10 20:28:27 +00:00
WPHTTP-testcase-redirection-script.php Docs: Improve inline comments per the documentation standards. 2020-01-29 00:43:23 +00:00