Media: Output WebP by default when uploading JPEGs.

Uploaded JPEGs will automatically be converted to WebP sub-sizes instead of JPEG, saving space and making sites faster.

The original JPEG upload is always retained and can be accessed by calling `wp_get_original_image_url`.

Props azaozz, flixos90.
Fixes #55443.



git-svn-id: https://develop.svn.wordpress.org/trunk@54086 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Adam Silverstein
2022-09-06 21:13:17 +00:00
parent 87047ccf3a
commit 3099698d7b
13 changed files with 167 additions and 12 deletions

View File

@@ -14,6 +14,15 @@ abstract class WP_Tests_Image_Resize_UnitTestCase extends WP_Image_UnitTestCase
parent::set_up();
add_filter( 'wp_image_editors', array( $this, 'wp_image_editors' ) );
add_filter( 'image_editor_output_format', '__return_empty_array' );
}
/**
* Tear down the class.
*/
public function tear_down() {
remove_filter( 'image_editor_output_format', '__return_empty_array' );
parent::tear_down();
}
public function wp_image_editors() {