diff --git src/wp-admin/includes/image-edit.php src/wp-admin/includes/image-edit.php
index ce80a69ad5..416f69c998 100644
--- src/wp-admin/includes/image-edit.php
+++ src/wp-admin/includes/image-edit.php
@@ -306,6 +306,12 @@ function wp_stream_image( $image, $mime_type, $attachment_id ) {
 			case 'image/gif':
 				header( 'Content-Type: image/gif' );
 				return imagegif( $image );
+			case 'image/webp':
+				if ( function_exists( 'imagewebp' ) ) {
+					header( 'Content-Type: image/webp' );
+					return imagewebp( $image, null, 90 );
+				}
+				return false;
 			default:
 				return false;
 		}
@@ -391,6 +397,11 @@ function wp_save_image_file( $filename, $image, $mime_type, $post_id ) {
 				return imagepng( $image, $filename );
 			case 'image/gif':
 				return imagegif( $image, $filename );
+			case 'image/webp':
+				if ( function_exists( 'imagewebp' ) ) {
+					return imagewebp( $image, null, apply_filters( 'jpeg_quality', 90, 'edit_image' ) );
+				}
+				return false;
 			default:
 				return false;
 		}
diff --git src/wp-admin/includes/image.php src/wp-admin/includes/image.php
index 56b9c0a36f..261d8949fa 100644
--- src/wp-admin/includes/image.php
+++ src/wp-admin/includes/image.php
@@ -517,6 +517,9 @@ function wp_generate_attachment_metadata( $attachment_id, $file ) {
 				case 'image/png':
 					$ext = '.png';
 					break;
+				case 'image/webp':
+					$ext = '.webp';
+					break;
 			}
 			$basename = str_replace( '.', '-', wp_basename( $file ) ) . '-image' . $ext;
 			$uploaded = wp_upload_bits( $basename, '', $metadata['image']['data'] );
@@ -912,7 +915,7 @@ function file_is_valid_image( $path ) {
  * @return bool True if suitable, false if not suitable.
  */
 function file_is_displayable_image( $path ) {
-	$displayable_image_types = array( IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG, IMAGETYPE_BMP, IMAGETYPE_ICO );
+	$displayable_image_types = array( IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG, IMAGETYPE_BMP, IMAGETYPE_ICO, IMAGETYPE_WEBP ); // phpcs:ignore PHPCompatibility.Constants.NewConstants.imagetype_webpFound
 
 	$info = wp_getimagesize( $path );
 	if ( empty( $info ) ) {
@@ -962,6 +965,13 @@ function load_image_to_edit( $attachment_id, $mime_type, $size = 'full' ) {
 		case 'image/gif':
 			$image = imagecreatefromgif( $filepath );
 			break;
+		case 'image/webp':
+			if ( function_exists( 'imagecreatefromwebp' ) ) {
+				$image = imagecreatefromwebp( $filepath );
+			} else {
+				$image = false;
+			}
+			break;
 		default:
 			$image = false;
 			break;
diff --git src/wp-admin/includes/media.php src/wp-admin/includes/media.php
index 567cd1f823..4d3d2f3950 100644
--- src/wp-admin/includes/media.php
+++ src/wp-admin/includes/media.php
@@ -993,7 +993,7 @@ function wp_media_upload_handler() {
 function media_sideload_image( $file, $post_id = 0, $desc = null, $return = 'html' ) {
 	if ( ! empty( $file ) ) {
 
-		$allowed_extensions = array( 'jpg', 'jpeg', 'jpe', 'png', 'gif' );
+		$allowed_extensions = array( 'jpg', 'jpeg', 'jpe', 'png', 'gif', 'webp' );
 
 		/**
 		 * Filters the list of allowed file extensions when sideloading an image from a URL.
diff --git src/wp-admin/includes/schema.php src/wp-admin/includes/schema.php
index a59c7c36ce..6f528f2288 100644
--- src/wp-admin/includes/schema.php
+++ src/wp-admin/includes/schema.php
@@ -1215,6 +1215,7 @@ We hope you enjoy your new site. Thanks!
 		'jpeg',
 		'png',
 		'gif',
+		'webp',
 		// Video.
 		'mov',
 		'avi',
diff --git src/wp-includes/ID3/getid3.lib.php src/wp-includes/ID3/getid3.lib.php
index 3a5983fc26..3dfb653697 100644
--- src/wp-includes/ID3/getid3.lib.php
+++ src/wp-includes/ID3/getid3.lib.php
@@ -1511,7 +1511,7 @@ class getid3_lib
 			if (is_writable($tempfilename) && is_file($tempfilename) && ($tmp = fopen($tempfilename, 'wb'))) {
 				fwrite($tmp, $imgData);
 				fclose($tmp);
-				$GetDataImageSize = @getimagesize($tempfilename, $imageinfo);
+				$GetDataImageSize = @wp_getimagesize($tempfilename, $imageinfo);
 				if (($GetDataImageSize === false) || !isset($GetDataImageSize[0]) || !isset($GetDataImageSize[1])) {
 					return false;
 				}
diff --git src/wp-includes/ID3/getid3.php src/wp-includes/ID3/getid3.php
index 5cb3c036c0..a5a9b50589 100644
--- src/wp-includes/ID3/getid3.php
+++ src/wp-includes/ID3/getid3.php
@@ -1183,7 +1183,14 @@ class getID3
 							'fail_id3'  => 'ERROR',
 							'fail_ape'  => 'ERROR',
 						),
-
+				'webp' => array(
+						'pattern'   => '^WEBP',
+						'group'     => 'graphic',
+						'module'    => 'webp',
+						'mime_type' => 'image/webp',
+						'fail_id3'  => 'ERROR',
+						'fail_ape'  => 'ERROR',
+					),
 				// PCD  - still image - Kodak Photo CD
 				'pcd'  => array(
 							'pattern'   => '^.{2048}PCD_IPI\\x00',
diff --git src/wp-includes/class-wp-image-editor-gd.php src/wp-includes/class-wp-image-editor-gd.php
index ed0a7be279..964bc4c712 100644
--- src/wp-includes/class-wp-image-editor-gd.php
+++ src/wp-includes/class-wp-image-editor-gd.php
@@ -69,6 +69,8 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
 				return ( $image_types & IMG_PNG ) != 0;
 			case 'image/gif':
 				return ( $image_types & IMG_GIF ) != 0;
+			case 'image/webp':
+				return ( $image_types & IMG_WEBP ) != 0; // phpcs:ignore PHPCompatibility.Constants.NewConstants.img_webpFound
 		}
 
 		return false;
@@ -99,7 +101,15 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
 			return new WP_Error( 'error_loading_image', __( 'File doesn&#8217;t exist?' ), $this->file );
 		}
 
-		$this->image = @imagecreatefromstring( $file_contents );
+		// WebP may not work with imagecreatefromstring().
+		if (
+			function_exists( 'imagecreatefromwebp' ) &&
+			( 'image/webp' === wp_get_image_mime( $this->file ) )
+		) {
+			$this->image = @imagecreatefromwebp( $this->file );
+		} else {
+			$this->image = @imagecreatefromstring( $file_contents );
+		}
 
 		if ( ! is_gd_image( $this->image ) ) {
 			return new WP_Error( 'invalid_image', __( 'File is not an image.' ), $this->file );
@@ -459,6 +469,10 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
 			if ( ! $this->make_image( $filename, 'imagejpeg', array( $image, $filename, $this->get_quality() ) ) ) {
 				return new WP_Error( 'image_save_error', __( 'Image Editor Save Failed' ) );
 			}
+		} elseif ( 'image/webp' == $mime_type ) {
+			if ( ! $this->make_image( $filename, 'imagewebp', array( $image, $filename, $this->get_quality() ) ) ) {
+				return new WP_Error( 'image_save_error', __( 'Image Editor Save Failed' ) );
+			}
 		} else {
 			return new WP_Error( 'image_save_error', __( 'Image Editor Save Failed' ) );
 		}
@@ -502,6 +516,12 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
 			case 'image/gif':
 				header( 'Content-Type: image/gif' );
 				return imagegif( $this->image );
+			case 'image/webp':
+				if ( function_exists( 'imagewebp' ) ) {
+					header( 'Content-Type: image/webp' );
+					return imagewebp( $this->image, null, $this->get_quality() );
+				}
+				// Fall back to the default if webp isn't supported.
 			default:
 				header( 'Content-Type: image/jpeg' );
 				return imagejpeg( $this->image, null, $this->get_quality() );
diff --git src/wp-includes/class-wp-image-editor.php src/wp-includes/class-wp-image-editor.php
index 7dcdc91d5a..ad92a912f9 100644
--- src/wp-includes/class-wp-image-editor.php
+++ src/wp-includes/class-wp-image-editor.php
@@ -316,6 +316,39 @@ abstract class WP_Image_Editor {
 			$new_ext   = $file_ext;
 		}
 
+		// Remap legacy formats to modern formats.
+		$image_editor_mime_mapping = array(
+			// Map jpeg images to webp images by default.
+			'image/jpeg' => array(
+				'mime_type' => 'image/webp',
+				'extension' => 'webp',
+			),
+		);
+
+		/**
+		 * Filters the default mime mapping.
+		 *
+		 * @see get_output_format()
+		 *
+		 * @since 5.8.0
+		 *
+		 * @param array $image_editor_mime_mapping {
+		 *     An array of mime type mappings. Maps a source mime type to a new
+		 *     destination mime type and file extension.
+		 *
+		 *     @type array $mime_type The source mime type {
+		 *         @type string $mime_type The new mime type.
+		 *         @type string $extension The new mime file extension.
+		 *     }
+		 * }
+		 */
+		$image_editor_mime_mapping = apply_filters( 'image_editor_mime_mapping', $image_editor_mime_mapping, $filename, $mime_type );
+
+		if ( $image_editor_mime_mapping && isset( $image_editor_mime_mapping[ $mime_type ] ) && $image_editor_mime_mapping[ $mime_type ] ) {
+			$new_ext   = $image_editor_mime_mapping[ $mime_type ]['extension'];
+			$mime_type = $image_editor_mime_mapping[ $mime_type ]['mime_type'];
+		}
+
 		// Double-check that the mime-type selected is supported by the editor.
 		// If not, choose a default instead.
 		if ( ! $this->supports_mime_type( $mime_type ) ) {
diff --git src/wp-includes/class-wp-theme.php src/wp-includes/class-wp-theme.php
index d9ccf6b6ba..b365f45715 100644
--- src/wp-includes/class-wp-theme.php
+++ src/wp-includes/class-wp-theme.php
@@ -1141,7 +1141,7 @@ final class WP_Theme implements ArrayAccess {
 			return false;
 		}
 
-		foreach ( array( 'png', 'gif', 'jpg', 'jpeg' ) as $ext ) {
+		foreach ( array( 'png', 'gif', 'jpg', 'jpeg', 'webp' ) as $ext ) {
 			if ( file_exists( $this->get_stylesheet_directory() . "/screenshot.$ext" ) ) {
 				$this->cache_add( 'screenshot', 'screenshot.' . $ext );
 				if ( 'relative' === $uri ) {
diff --git src/wp-includes/compat.php src/wp-includes/compat.php
index 7f6c59f03c..59e5700439 100644
--- src/wp-includes/compat.php
+++ src/wp-includes/compat.php
@@ -370,3 +370,11 @@ if ( ! function_exists( 'is_iterable' ) ) {
 		return ( is_array( $var ) || $var instanceof Traversable );
 	}
 }
+
+// WebP constants may not be defined, even in cases where the format is supported.
+if ( ! defined( 'IMAGETYPE_WEBP' ) ) {
+	define( 'IMAGETYPE_WEBP', 18 );
+}
+if ( ! defined( 'IMG_WEBP' ) ) {
+	define( 'IMG_WEBP', IMAGETYPE_WEBP ); // phpcs:ignore PHPCompatibility.Constants.NewConstants.imagetype_webpFound
+}
diff --git src/wp-includes/customize/class-wp-customize-media-control.php src/wp-includes/customize/class-wp-customize-media-control.php
index fc4801a96e..1dc1b8c277 100644
--- src/wp-includes/customize/class-wp-customize-media-control.php
+++ src/wp-includes/customize/class-wp-customize-media-control.php
@@ -91,7 +91,7 @@ class WP_Customize_Media_Control extends WP_Customize_Control {
 				// Fake an attachment model - needs all fields used by template.
 				// Note that the default value must be a URL, NOT an attachment ID.
 				$ext  = substr( $this->setting->default, -3 );
-				$type = in_array( $ext, array( 'jpg', 'png', 'gif', 'bmp' ), true ) ? 'image' : 'document';
+				$type = in_array( $ext, array( 'jpg', 'png', 'gif', 'bmp', 'webp' ), true ) ? 'image' : 'document';
 
 				$default_attachment = array(
 					'id'    => 1,
diff --git src/wp-includes/deprecated.php src/wp-includes/deprecated.php
index 72a23cd836..2c5f24bde0 100644
--- src/wp-includes/deprecated.php
+++ src/wp-includes/deprecated.php
@@ -3340,6 +3340,8 @@ function gd_edit_image_support($mime_type) {
 				return (imagetypes() & IMG_PNG) != 0;
 			case 'image/gif':
 				return (imagetypes() & IMG_GIF) != 0;
+			case 'image/webp':
+				return (imagetypes() & IMG_WEBP) != 0; // phpcs:ignore PHPCompatibility.Constants.NewConstants.img_webpFound
 		}
 	} else {
 		switch( $mime_type ) {
@@ -3349,6 +3351,8 @@ function gd_edit_image_support($mime_type) {
 				return function_exists('imagecreatefrompng');
 			case 'image/gif':
 				return function_exists('imagecreatefromgif');
+			case 'image/webp':
+				return function_exists('imagecreatefromwebp');
 		}
 	}
 	return false;
diff --git src/wp-includes/formatting.php src/wp-includes/formatting.php
index b716c6bc1f..8dda8c738d 100644
--- src/wp-includes/formatting.php
+++ src/wp-includes/formatting.php
@@ -3318,7 +3318,7 @@ function translate_smiley( $matches ) {
 
 	$matches    = array();
 	$ext        = preg_match( '/\.([^.]+)$/', $img, $matches ) ? strtolower( $matches[1] ) : false;
-	$image_exts = array( 'jpg', 'jpeg', 'jpe', 'gif', 'png' );
+	$image_exts = array( 'jpg', 'jpeg', 'jpe', 'gif', 'png', 'webp' );
 
 	// Don't convert smilies that aren't images - they're probably emoji.
 	if ( ! in_array( $ext, $image_exts, true ) ) {
diff --git src/wp-includes/functions.php src/wp-includes/functions.php
index 56d5fd9f43..027ed3074c 100644
--- src/wp-includes/functions.php
+++ src/wp-includes/functions.php
@@ -2886,6 +2886,7 @@ function wp_check_filetype_and_ext( $file, $filename, $mimes = null ) {
 					'image/gif'  => 'gif',
 					'image/bmp'  => 'bmp',
 					'image/tiff' => 'tif',
+					'image/webp' => 'webp',
 				)
 			);
 
@@ -3063,6 +3064,23 @@ function wp_get_image_mime( $file ) {
 		} else {
 			$mime = false;
 		}
+
+		// WebP support took longer to land in Exif than GD.
+		if ( ! $mime ) {
+			$handle = fopen( $file, 'rb' );
+			if ( $handle ) {
+				$magic = bin2hex( fread( $handle, 12 ) );
+				if (
+					// RIFF.
+					( 0 === strpos( $magic, '52494646' ) ) &&
+					// WEBP.
+					( 16 === strpos( $magic, '57454250' ) )
+				) {
+					$mime = 'image/webp';
+				}
+				fclose( $handle );
+			}
+		}
 	} catch ( Exception $e ) {
 		$mime = false;
 	}
@@ -3101,6 +3119,7 @@ function wp_get_mime_types() {
 			'png'                          => 'image/png',
 			'bmp'                          => 'image/bmp',
 			'tiff|tif'                     => 'image/tiff',
+			'webp'                         => 'image/webp',
 			'ico'                          => 'image/x-icon',
 			'heic'                         => 'image/heic',
 			// Video formats.
@@ -3222,7 +3241,7 @@ function wp_get_ext_types() {
 	return apply_filters(
 		'ext2type',
 		array(
-			'image'       => array( 'jpg', 'jpeg', 'jpe', 'gif', 'png', 'bmp', 'tif', 'tiff', 'ico', 'heic' ),
+			'image'       => array( 'jpg', 'jpeg', 'jpe', 'gif', 'png', 'bmp', 'tif', 'tiff', 'ico', 'heic', 'webp' ),
 			'audio'       => array( 'aac', 'ac3', 'aif', 'aiff', 'flac', 'm3a', 'm4a', 'm4b', 'mka', 'mp1', 'mp2', 'mp3', 'ogg', 'oga', 'ram', 'wav', 'wma' ),
 			'video'       => array( '3g2', '3gp', '3gpp', 'asf', 'avi', 'divx', 'dv', 'flv', 'm4v', 'mkv', 'mov', 'mp4', 'mpeg', 'mpg', 'mpv', 'ogm', 'ogv', 'qt', 'rm', 'vob', 'wmv' ),
 			'document'    => array( 'doc', 'docx', 'docm', 'dotm', 'odt', 'pages', 'pdf', 'xps', 'oxps', 'rtf', 'wp', 'wpd', 'psd', 'xcf' ),
diff --git src/wp-includes/media.php src/wp-includes/media.php
index b0e2c79aef..e44eb589df 100644
--- src/wp-includes/media.php
+++ src/wp-includes/media.php
@@ -4974,6 +4974,7 @@ function wp_show_heic_upload_error( $plupload_settings ) {
  * Allows PHP's getimagesize() to be debuggable when necessary.
  *
  * @since 5.7.0
+ * @since 5.8.0 Added support for WebP images.
  *
  * @param string $filename  The file path.
  * @param array  $imageinfo Extended image information, passed by reference.
@@ -4987,7 +4988,7 @@ function wp_getimagesize( $filename, &$imageinfo = array() ) {
 		// Return without silencing errors when in debug mode.
 		defined( 'WP_DEBUG' ) && WP_DEBUG
 	) {
-		return getimagesize( $filename, $imageinfo );
+		return _get_image_size( $filename, $imageinfo );
 	}
 
 	/*
@@ -5001,5 +5002,89 @@ function wp_getimagesize( $filename, &$imageinfo = array() ) {
 	 *
 	 * phpcs:ignore WordPress.PHP.NoSilencedErrors
 	 */
-	return @getimagesize( $filename, $imageinfo );
+	return @_get_image_size( $filename, $imageinfo );
+}
+
+/**
+ * Get the image size, with support for WebP images.
+ *
+ * @since 5.8.0
+ *
+ * @param string $filename  The file path.
+ * @param array  $imageinfo Extended image information, passed by reference.
+ */
+function _get_image_size( $filename, &$imageinfo = array() ) {
+	// Try getimagesize() first.
+	$info = getimagesize( $filename, $imageinfo );
+	if ( false !== $info ) {
+		return $info;
+	}
+
+	// For PHP versions that don't support WebP images, pull info from the file headers.
+	if ( 'image/webp' === wp_get_image_mime( $filename ) ) {
+		try {
+			$handle = fopen( $filename, 'rb' );
+			if ( $handle ) {
+				$magic = fread( $handle, 40 );
+				fclose( $handle );
+
+				// Make sure we got enough bytes.
+				if ( strlen( $magic ) < 40 ) {
+					return false;
+				}
+
+				$width  = false;
+				$height = false;
+
+				// The headers are a little different for each of the three formats.
+				switch ( substr( $magic, 12, 4 ) ) {
+					// Lossy WebP.
+					case 'VP8 ':
+						$parts  = unpack( 'v2', substr( $magic, 26, 4 ) );
+						$width  = (int) ( $parts[1] & 0x3FFF );
+						$height = (int) ( $parts[2] & 0x3FFF );
+						break;
+					// Lossless WebP.
+					case 'VP8L':
+						$parts  = unpack( 'C4', substr( $magic, 21, 4 ) );
+						$width  = (int) ( $parts[1] | ( ( $parts[2] & 0x3F ) << 8 ) ) + 1;
+						$height = (int) ( ( ( $parts[2] & 0xC0 ) >> 6 ) |
+										( $parts[3] << 2 ) | ( ( $parts[4] & 0x03 ) << 10 ) ) + 1;
+						break;
+					// Animated/alpha WebP.
+					case 'VP8X':
+						// Pad 24-bit int.
+						$width = unpack( 'V', substr( $magic, 24, 3 ) . "\x00" );
+						$width = (int) ( $width[1] & 0xFFFFFF ) + 1;
+
+						// Pad 24-bit int.
+						$height = unpack( 'V', substr( $magic, 27, 3 ) . "\x00" );
+						$height = (int) ( $height[1] & 0xFFFFFF ) + 1;
+						break;
+				}
+
+				// Mimic the native return format.
+				if ( $width && $height ) {
+					return array(
+						$width,
+						$height,
+						IMAGETYPE_WEBP, // phpcs:ignore PHPCompatibility.Constants.NewConstants.imagetype_webpFound
+						sprintf(
+							'width="%d" height="%d"',
+							$width,
+							$height
+						),
+						'mime' => 'image/webp',
+					);
+				}
+
+				// The image could not be parsed.
+				return false;
+			}
+		} catch ( Exception $e ) {
+			return false;
+		}
+
+		return false;
+	}
 }
diff --git src/wp-includes/post.php src/wp-includes/post.php
index ced0275db4..6d1f03647d 100644
--- src/wp-includes/post.php
+++ src/wp-includes/post.php
@@ -6535,7 +6535,7 @@ function wp_attachment_is( $type, $post = null ) {
 
 	switch ( $type ) {
 		case 'image':
-			$image_exts = array( 'jpg', 'jpeg', 'jpe', 'gif', 'png' );
+			$image_exts = array( 'jpg', 'jpeg', 'jpe', 'gif', 'png', 'webp' );
 			return in_array( $ext, $image_exts, true );
 
 		case 'audio':
diff --git tests/phpunit/data/images/webp-animated.webp tests/phpunit/data/images/webp-animated.webp
new file mode 100644
index 0000000000..c60d334a82
Binary files /dev/null and tests/phpunit/data/images/webp-animated.webp differ
diff --git tests/phpunit/data/images/webp-lossless.webp tests/phpunit/data/images/webp-lossless.webp
new file mode 100644
index 0000000000..7a3a06e0b4
Binary files /dev/null and tests/phpunit/data/images/webp-lossless.webp differ
diff --git tests/phpunit/data/images/webp-lossy.webp tests/phpunit/data/images/webp-lossy.webp
new file mode 100644
index 0000000000..c8b0e25391
Binary files /dev/null and tests/phpunit/data/images/webp-lossy.webp differ
diff --git tests/phpunit/data/images/webp-transparent.webp tests/phpunit/data/images/webp-transparent.webp
new file mode 100644
index 0000000000..c4b24a08be
Binary files /dev/null and tests/phpunit/data/images/webp-transparent.webp differ
diff --git tests/phpunit/tests/functions.php tests/phpunit/tests/functions.php
index f485d3b4ec..75a2ecf5e0 100644
--- tests/phpunit/tests/functions.php
+++ tests/phpunit/tests/functions.php
@@ -1225,6 +1225,29 @@ class Tests_Functions extends WP_UnitTestCase {
 		$this->assertSame( $expected, wp_get_image_mime( $file ) );
 	}
 
+	/**
+	 * @ticket 35725
+	 * @dataProvider _wp_getimagesize
+	 */
+	public function test_wp_getimagesize( $file, $expected ) {
+		if ( ! is_callable( 'exif_imagetype' ) && ! function_exists( 'getimagesize' ) ) {
+			$this->markTestSkipped( 'The exif PHP extension is not loaded.' );
+		}
+
+		$result = wp_getimagesize( $file );
+
+		// The getimagesize() function varies in its response, so
+		// let's restrict comparison to expected keys only.
+		if ( is_array( $expected ) ) {
+			foreach ( $expected as $k => $v ) {
+				$this->assertEquals( true, isset( $result[ $k ] ) );
+				$this->assertEquals( $expected[ $k ], $result[ $k ] );
+			}
+		} else {
+			$this->assertEquals( $expected, $result );
+		}
+	}
+
 	/**
 	 * @ticket 39550
 	 * @dataProvider _wp_check_filetype_and_ext_data
@@ -1313,6 +1336,129 @@ class Tests_Functions extends WP_UnitTestCase {
 				DIR_TESTDATA . '/images/test-image-mime-jpg.png',
 				'image/jpeg',
 			),
+			// Animated WebP.
+			array(
+				DIR_TESTDATA . '/images/webp-animated.webp',
+				'image/webp',
+			),
+			// Lossless WebP.
+			array(
+				DIR_TESTDATA . '/images/webp-lossless.webp',
+				'image/webp',
+			),
+			// Lossy WebP.
+			array(
+				DIR_TESTDATA . '/images/webp-lossy.webp',
+				'image/webp',
+			),
+			// Transparent WebP.
+			array(
+				DIR_TESTDATA . '/images/webp-transparent.webp',
+				'image/webp',
+			),
+			// Not an image.
+			array(
+				DIR_TESTDATA . '/uploads/dashicons.woff',
+				false,
+			),
+		);
+
+		return $data;
+	}
+
+	/**
+	 * Data profider for test_wp_getimagesize();
+	 */
+	public function _wp_getimagesize() {
+		$data = array(
+			// Standard JPEG.
+			array(
+				DIR_TESTDATA . '/images/test-image.jpg',
+				array(
+					50,
+					50,
+					IMAGETYPE_JPEG,
+					'width="50" height="50"',
+					'mime' => 'image/jpeg',
+				),
+			),
+			// Standard GIF.
+			array(
+				DIR_TESTDATA . '/images/test-image.gif',
+				array(
+					50,
+					50,
+					IMAGETYPE_GIF,
+					'width="50" height="50"',
+					'mime' => 'image/gif',
+				),
+			),
+			// Standard PNG.
+			array(
+				DIR_TESTDATA . '/images/test-image.png',
+				array(
+					50,
+					50,
+					IMAGETYPE_PNG,
+					'width="50" height="50"',
+					'mime' => 'image/png',
+				),
+			),
+			// Image with wrong extension.
+			array(
+				DIR_TESTDATA . '/images/test-image-mime-jpg.png',
+				array(
+					50,
+					50,
+					IMAGETYPE_JPEG,
+					'width="50" height="50"',
+					'mime' => 'image/jpeg',
+				),
+			),
+			// Animated WebP.
+			array(
+				DIR_TESTDATA . '/images/webp-animated.webp',
+				array(
+					100,
+					100,
+					IMAGETYPE_WEBP,
+					'width="100" height="100"',
+					'mime' => 'image/webp',
+				),
+			),
+			// Lossless WebP.
+			array(
+				DIR_TESTDATA . '/images/webp-lossless.webp',
+				array(
+					1200,
+					675,
+					IMAGETYPE_WEBP,
+					'width="1200" height="675"',
+					'mime' => 'image/webp',
+				),
+			),
+			// Lossy WebP.
+			array(
+				DIR_TESTDATA . '/images/webp-lossy.webp',
+				array(
+					1200,
+					675,
+					IMAGETYPE_WEBP,
+					'width="1200" height="675"',
+					'mime' => 'image/webp',
+				),
+			),
+			// Transparent WebP.
+			array(
+				DIR_TESTDATA . '/images/webp-transparent.webp',
+				array(
+					1200,
+					675,
+					IMAGETYPE_WEBP,
+					'width="1200" height="675"',
+					'mime' => 'image/webp',
+				),
+			),
 			// Not an image.
 			array(
 				DIR_TESTDATA . '/uploads/dashicons.woff',
diff --git tests/phpunit/tests/image/editorGd.php tests/phpunit/tests/image/editorGd.php
index d2523f4c6f..d2493d9650 100644
--- tests/phpunit/tests/image/editorGd.php
+++ tests/phpunit/tests/image/editorGd.php
@@ -17,6 +17,8 @@ class Tests_Image_Editor_GD extends WP_Image_UnitTestCase {
 		require_once ABSPATH . WPINC . '/class-wp-image-editor.php';
 		require_once ABSPATH . WPINC . '/class-wp-image-editor-gd.php';
 
+		add_filter( 'image_editor_mime_mapping', '__return_false' );
+
 		// This needs to come after the mock image editor class is loaded.
 		parent::setUp();
 	}
@@ -29,6 +31,7 @@ class Tests_Image_Editor_GD extends WP_Image_UnitTestCase {
 		}
 
 		$this->remove_added_uploads();
+		remove_filter( 'image_editor_mime_mapping', '__return_false' );
 
 		parent::tearDown();
 	}
@@ -110,6 +113,50 @@ class Tests_Image_Editor_GD extends WP_Image_UnitTestCase {
 		);
 	}
 
+	/**
+	 * Test multi_resize with single image resize and no crop, with auto conversion
+	 * to the webp format.
+	 */
+	public function test_single_multi_resize_to_webp() {
+		remove_filter( 'image_editor_mime_mapping', '__return_false' );
+
+		$file = DIR_TESTDATA . '/images/waffles.jpg';
+
+		$gd_image_editor = new WP_Image_Editor_GD( $file );
+		$gd_image_editor->load();
+
+		$sizes_array = array(
+			array(
+				'width'  => 50,
+				'height' => 50,
+			),
+		);
+
+		$resized = $gd_image_editor->multi_resize( $sizes_array );
+
+		// First, check to see if returned array is as expected.
+		$expected_array = array(
+			array(
+				'file'      => 'waffles-50x33.webp',
+				'width'     => 50,
+				'height'    => 33,
+				'mime-type' => 'image/webp',
+			),
+		);
+
+		$this->assertSame( $expected_array, $resized );
+
+		// Now, verify real dimensions are as expected.
+		$image_path = DIR_TESTDATA . '/images/' . $resized[0]['file'];
+		$this->assertImageDimensions(
+			$image_path,
+			$expected_array[0]['width'],
+			$expected_array[0]['height']
+		);
+		add_filter( 'image_editor_mime_mapping', '__return_false' );
+	}
+
+
 	/**
 	 * Ensure multi_resize doesn't create an image when
 	 * both height and weight are missing, null, or 0.
diff --git tests/phpunit/tests/image/functions.php tests/phpunit/tests/image/functions.php
index 1694c1e7f1..315e6aae90 100644
--- tests/phpunit/tests/image/functions.php
+++ tests/phpunit/tests/image/functions.php
@@ -25,6 +25,12 @@ class Tests_Image_Functions extends WP_UnitTestCase {
 		foreach ( glob( $folder ) as $file ) {
 			unlink( $file );
 		}
+		add_filter( 'image_editor_mime_mapping', '__return_false' );
+	}
+
+	public function tearDown() {
+		parent::tearDown();
+		remove_filter( 'image_editor_mime_mapping', '__return_false' );
 	}
 
 	/**
@@ -59,6 +65,10 @@ class Tests_Image_Functions extends WP_UnitTestCase {
 			'test-image.psd',
 			'test-image-zip.tiff',
 			'test-image.jpg',
+			'webp-animated.webp',
+			'webp-lossless.webp',
+			'webp-lossy.webp',
+			'webp-transparent.webp',
 		);
 
 		// IMAGETYPE_ICO is only defined in PHP 5.3+.
@@ -90,6 +100,10 @@ class Tests_Image_Functions extends WP_UnitTestCase {
 			'test-image.gif',
 			'test-image.png',
 			'test-image.jpg',
+			'webp-animated.webp',
+			'webp-lossless.webp',
+			'webp-lossy.webp',
+			'webp-transparent.webp',
 		);
 
 		// IMAGETYPE_ICO is only defined in PHP 5.3+.
@@ -152,6 +166,7 @@ class Tests_Image_Functions extends WP_UnitTestCase {
 	 * @requires extension fileinfo
 	 */
 	public function test_wp_save_image_file() {
+		add_filter( 'image_editor_mime_mapping', '__return_false' );
 		$classes = array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );
 
 		foreach ( $classes as $key => $class ) {
@@ -172,6 +187,7 @@ class Tests_Image_Functions extends WP_UnitTestCase {
 			'image/jpeg',
 			'image/gif',
 			'image/png',
+			'image/webp',
 		);
 
 		// Test each image editor engine.
@@ -270,7 +286,8 @@ class Tests_Image_Functions extends WP_UnitTestCase {
 			'jpe'  => 'image/jpeg',
 			'gif'  => 'image/gif',
 			'png'  => 'image/png',
-			'unk'  => 'image/jpeg', // Default, unknown.
+			'webp' => 'image/webp',
+			'unk'  => 'image/jpeg',   // Default, unknown.
 		);
 
 		// Test each image editor engine.
diff --git tests/phpunit/tests/image/intermediateSize.php tests/phpunit/tests/image/intermediateSize.php
index b92c833a9d..08b3a015de 100644
--- tests/phpunit/tests/image/intermediateSize.php
+++ tests/phpunit/tests/image/intermediateSize.php
@@ -5,6 +5,14 @@
  * @group upload
  */
 class Tests_Image_Intermediate_Size extends WP_UnitTestCase {
+	/**
+	 * Setup test fixture
+	 */
+	public function setUp() {
+		parent::setUp();
+		add_filter( 'image_editor_mime_mapping', '__return_false' );
+	}
+
 	function tearDown() {
 		$this->remove_added_uploads();
 
@@ -12,6 +20,7 @@ class Tests_Image_Intermediate_Size extends WP_UnitTestCase {
 		remove_image_size( 'false-height' );
 		remove_image_size( 'false-width' );
 		remove_image_size( 'off-by-one' );
+		remove_filter( 'image_editor_mime_mapping', '__return_false' );
 		parent::tearDown();
 	}
 
diff --git tests/phpunit/tests/image/resize.php tests/phpunit/tests/image/resize.php
index 3e3255e6a5..cc66256769 100644
--- tests/phpunit/tests/image/resize.php
+++ tests/phpunit/tests/image/resize.php
@@ -14,6 +14,12 @@ abstract class WP_Tests_Image_Resize_UnitTestCase extends WP_Image_UnitTestCase
 		parent::setUp();
 
 		add_filter( 'wp_image_editors', array( $this, 'wp_image_editors' ) );
+		add_filter( 'image_editor_mime_mapping', '__return_false' );
+	}
+
+	public function tearDown() {
+		parent::tearDown();
+		remove_filter( 'image_editor_mime_mapping', '__return_false' );
 	}
 
 	public function wp_image_editors() {
diff --git tests/phpunit/tests/media.php tests/phpunit/tests/media.php
index bc9b593d15..df755691ba 100644
--- tests/phpunit/tests/media.php
+++ tests/phpunit/tests/media.php
@@ -11,6 +11,8 @@ class Tests_Media extends WP_UnitTestCase {
 	protected static $post_ids;
 
 	public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
+		add_filter( 'image_editor_mime_mapping', '__return_false' );
+
 		self::$_sizes                          = wp_get_additional_image_sizes();
 		$GLOBALS['_wp_additional_image_sizes'] = array();
 
@@ -49,6 +51,7 @@ class Tests_Media extends WP_UnitTestCase {
 
 	public static function wpTearDownAfterClass() {
 		$GLOBALS['_wp_additional_image_sizes'] = self::$_sizes;
+		remove_filter( 'image_editor_mime_mapping', '__return_false' );
 	}
 
 	public static function tearDownAfterClass() {
diff --git tests/phpunit/tests/post/attachments.php tests/phpunit/tests/post/attachments.php
index 0a03d77ed6..ff3ba64541 100644
--- tests/phpunit/tests/post/attachments.php
+++ tests/phpunit/tests/post/attachments.php
@@ -6,10 +6,18 @@
  * @group upload
  */
 class Tests_Post_Attachments extends WP_UnitTestCase {
+	/**
+	 * Setup test fixture
+	 */
+	public function setUp() {
+		parent::setUp();
+		add_filter( 'image_editor_mime_mapping', '__return_false' );
+	}
 
 	function tearDown() {
 		// Remove all uploads.
 		$this->remove_added_uploads();
+		remove_filter( 'image_editor_mime_mapping', '__return_false' );
 		parent::tearDown();
 	}
 
