wordpress-develop/tests/phpunit/data/images
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
..
2004-07-22-DSC_0007.jpg
2004-07-22-DSC_0008.jpg
2007-06-17DSC_4173.JPG
33772.jpg Add test image for test_exif_keywords test 2015-09-22 21:42:45 +00:00
a2-small.jpg
canola.jpg
codeispoetry.png Tests: Replace broken codeispoetry.png file. 2017-01-11 16:24:30 +00:00
gradient-square.jpg
one-blue-pixel-1-100x100.png Upload: fix wp_unique_filename() to prevent name collisions with existing or future image sub-size file names, and add unit tests. 2019-12-06 22:26:19 +00:00
one-blue-pixel-100x100.png Media: Improve and fix rotate/flip image tests 2019-03-29 02:48:08 +00:00
sugarloaf-mountain.jpg Media: Replace tests/phpunit/data/images/sugar-mountain.jpg test image. 2021-11-29 20:16:32 +00:00
test-image-1-100x100.jpg Media: Fix wp_unique_filename() to check for name collisions with all alternate file names when an image may be converted after uploading. This includes possible collinions with pre-existing images whose sub-sizes/thumbnails are regenerated. 2021-08-24 20:50:21 +00:00
test-image-2.gif Media: Fix wp_unique_filename() to check for name collisions with all alternate file names when an image may be converted after uploading. This includes possible collinions with pre-existing images whose sub-sizes/thumbnails are regenerated. 2021-08-24 20:50:21 +00:00
test-image-3.jpg Media: Fix wp_unique_filename() to check for name collisions with all alternate file names when an image may be converted after uploading. This includes possible collinions with pre-existing images whose sub-sizes/thumbnails are regenerated. 2021-08-24 20:50:21 +00:00
test-image-4.png Media: Fix wp_unique_filename() to check for name collisions with all alternate file names when an image may be converted after uploading. This includes possible collinions with pre-existing images whose sub-sizes/thumbnails are regenerated. 2021-08-24 20:50:21 +00:00
test-image-cmyk.jpg Remove svn:executable from test files. 2015-07-26 09:40:58 +00:00
test-image-grayscale.jpg Remove svn:executable from test files. 2015-07-26 09:40:58 +00:00
test-image-iptc.jpg
test-image-large.jpg Media: Fix wp_image_file_matches_image_meta() to also match when the original image URL is used. 2020-07-12 21:18:38 +00:00
test-image-lzw.tiff
test-image-mime-jpg.png
test-image-no-extension PDF Images: Avoid a PHP Warning when attempting to process a file without an extension. 2016-12-12 06:18:30 +00:00
test-image-rotated-90ccw.jpg 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
test-image-rotated-90cw.webp 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
test-image-upside-down.jpg Media: Reset Exif orientation after rotate in WP_Image_Editor_Imagick. 2017-02-25 05:25:40 +00:00
test-image-zip.tiff
test-image.bmp
test-image.gif
test-image.ico Media: Recognize .ico files as displayable images on PHP 5.3+ and allow attachment meta data to be generated for them. 2018-03-05 01:02:20 +00:00
test-image.jp2
test-image.jpeg 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
test-image.jpg
test-image.pct
test-image.png
test-image.psd
test-image.sgi
test-image.tga
test-image.tiff
test-image.webp Images: enable WebP support. 2021-05-04 14:43:36 +00:00
transparent.png
waffles.jpg
webp-animated.webp Images: enable WebP support. 2021-05-04 14:43:36 +00:00
webp-lossless.webp Images: enable WebP support. 2021-05-04 14:43:36 +00:00
webp-lossy.webp Images: enable WebP support. 2021-05-04 14:43:36 +00:00
webp-transparent.webp Images: enable WebP support. 2021-05-04 14:43:36 +00:00
wordpress-gsoc-flyer.pdf Media: Add support for rendering PDF thumbnails. 2016-10-26 07:27:51 +00:00