diff --git src/wp-admin/custom-header.php src/wp-admin/custom-header.php
index c1a7896589..e7664a51f9 100644
--- src/wp-admin/custom-header.php
+++ src/wp-admin/custom-header.php
@@ -777,7 +777,7 @@ wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' );
 		}
 
 		if ( file_exists( $file ) ) {
-			list( $width, $height, $type, $attr ) = getimagesize( $file );
+			list( $width, $height, $type, $attr ) = wp_get_image_size( $file );
 		} else {
 			$data   = wp_get_attachment_metadata( $attachment_id );
 			$height = isset( $data['height'] ) ? $data['height'] : 0;
@@ -1209,7 +1209,7 @@ wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' );
 		$parent_url = wp_get_attachment_url( $parent->ID );
 		$url        = str_replace( basename( $parent_url ), basename( $cropped ), $parent_url );
 
-		$size       = @getimagesize( $cropped );
+		$size       = wp_get_image_size( $cropped );
 		$image_type = ( $size ) ? $size['mime'] : 'image/jpeg';
 
 		$object = array(
diff --git src/wp-admin/includes/ajax-actions.php src/wp-admin/includes/ajax-actions.php
index 8ced5d335a..9121fdc2f5 100644
--- src/wp-admin/includes/ajax-actions.php
+++ src/wp-admin/includes/ajax-actions.php
@@ -3611,7 +3611,7 @@ function wp_ajax_crop_image() {
 			$parent_url = wp_get_attachment_url( $attachment_id );
 			$url        = str_replace( basename( $parent_url ), basename( $cropped ), $parent_url );
 
-			$size       = @getimagesize( $cropped );
+			$size       = wp_get_image_size( $cropped );
 			$image_type = ( $size ) ? $size['mime'] : 'image/jpeg';
 
 			$object = array(
diff --git src/wp-admin/includes/class-wp-site-icon.php src/wp-admin/includes/class-wp-site-icon.php
index 47c48572f3..74d32df2b4 100644
--- src/wp-admin/includes/class-wp-site-icon.php
+++ src/wp-admin/includes/class-wp-site-icon.php
@@ -87,7 +87,7 @@ class WP_Site_Icon {
 		$parent_url = wp_get_attachment_url( $parent->ID );
 		$url        = str_replace( basename( $parent_url ), basename( $cropped ), $parent_url );
 
-		$size       = @getimagesize( $cropped );
+		$size       = wp_get_image_size( $cropped );
 		$image_type = ( $size ) ? $size['mime'] : 'image/jpeg';
 
 		$object = array(
diff --git src/wp-admin/includes/image-edit.php src/wp-admin/includes/image-edit.php
index 4be465d3db..0f38e86981 100644
--- src/wp-admin/includes/image-edit.php
+++ src/wp-admin/includes/image-edit.php
@@ -294,6 +294,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;
 		}
@@ -371,6 +377,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 0f03e2ca42..4814248f94 100644
--- src/wp-admin/includes/image.php
+++ src/wp-admin/includes/image.php
@@ -83,7 +83,7 @@ function wp_generate_attachment_metadata( $attachment_id, $file ) {
 	$mime_type = get_post_mime_type( $attachment );
 
 	if ( preg_match( '!^image/!', $mime_type ) && file_is_displayable_image( $file ) ) {
-		$imagesize          = getimagesize( $file );
+		$imagesize          = wp_get_image_size( $file );
 		$metadata['width']  = $imagesize[0];
 		$metadata['height'] = $imagesize[1];
 
@@ -188,6 +188,9 @@ function wp_generate_attachment_metadata( $attachment_id, $file ) {
 				case 'image/png':
 					$ext = '.png';
 					break;
+				case 'image/webp':
+					$ext = '.webp';
+					break;
 			}
 			$basename = str_replace( '.', '-', basename( $file ) ) . '-image' . $ext;
 			$uploaded = wp_upload_bits( $basename, '', $metadata['image']['data'] );
@@ -357,7 +360,7 @@ function wp_read_image_metadata( $file ) {
 		return false;
 	}
 
-	list( , , $sourceImageType ) = @getimagesize( $file );
+	list( , , $sourceImageType ) = wp_get_image_size( $file );
 
 	/*
 	 * EXIF contains a bunch of data we'll probably never need formatted in ways
@@ -386,7 +389,7 @@ function wp_read_image_metadata( $file ) {
 	 * as caption, description etc.
 	 */
 	if ( is_callable( 'iptcparse' ) ) {
-		@getimagesize( $file, $info );
+		wp_get_image_size( $file, $info );
 
 		if ( ! empty( $info['APP13'] ) ) {
 			$iptc = @iptcparse( $info['APP13'] );
@@ -541,7 +544,7 @@ function wp_read_image_metadata( $file ) {
  * @return bool True if valid image, false if not valid image.
  */
 function file_is_valid_image( $path ) {
-	$size = @getimagesize( $path );
+	$size = wp_get_image_size( $path );
 	return ! empty( $size );
 }
 
@@ -554,9 +557,9 @@ 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 );
+	$displayable_image_types = array( IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG, IMAGETYPE_BMP, IMAGETYPE_WEBP );
 
-	$info = @getimagesize( $path );
+	$info = wp_get_image_size( $path );
 	if ( empty( $info ) ) {
 		$result = false;
 	} elseif ( ! in_array( $info[2], $displayable_image_types ) ) {
@@ -602,6 +605,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/schema.php src/wp-admin/includes/schema.php
index edba6973a0..9cdf6ee4a4 100644
--- src/wp-admin/includes/schema.php
+++ src/wp-admin/includes/schema.php
@@ -1073,6 +1073,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 1931bb3724..e2dbd7e0b3 100644
--- src/wp-includes/ID3/getid3.lib.php
+++ src/wp-includes/ID3/getid3.lib.php
@@ -1201,7 +1201,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_get_image_size($tempfilename, $imageinfo);
 				if (($GetDataImageSize === false) || !isset($GetDataImageSize[0]) || !isset($GetDataImageSize[1])) {
 					return false;
 				}
@@ -1235,6 +1235,7 @@ class getid3_lib
 			$ImageTypesLookup[12] = 'jb2';
 			$ImageTypesLookup[13] = 'swc';
 			$ImageTypesLookup[14] = 'iff';
+			$ImageTypesLookup[18] = 'webp';
 		}
 		return (isset($ImageTypesLookup[$imagetypeid]) ? $ImageTypesLookup[$imagetypeid] : '');
 	}
diff --git src/wp-includes/class-phpmailer.php src/wp-includes/class-phpmailer.php
index 7f5e353578..ed5b6cf10d 100644
--- src/wp-includes/class-phpmailer.php
+++ src/wp-includes/class-phpmailer.php
@@ -3587,6 +3587,7 @@ class PHPMailer
             'png'   => 'image/png',
             'tiff'  => 'image/tiff',
             'tif'   => 'image/tiff',
+            'webp'  => 'image/webp',
             'eml'   => 'message/rfc822',
             'css'   => 'text/css',
             'html'  => 'text/html',
diff --git src/wp-includes/class-wp-image-editor-gd.php src/wp-includes/class-wp-image-editor-gd.php
index c8d1ed2f8d..d027380b20 100644
--- src/wp-includes/class-wp-image-editor-gd.php
+++ src/wp-includes/class-wp-image-editor-gd.php
@@ -73,6 +73,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;
 		}
 
 		return false;
@@ -97,13 +99,22 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
 		// Set artificially high because GD uses uncompressed images in memory.
 		wp_raise_memory_limit( 'image' );
 
-		$this->image = @imagecreatefromstring( file_get_contents( $this->file ) );
+		// 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_get_contents( $this->file ) );
+		}
 
 		if ( ! is_resource( $this->image ) ) {
 			return new WP_Error( 'invalid_image', __( 'File is not an image.' ), $this->file );
 		}
 
-		$size = @getimagesize( $this->file );
+		$size = wp_get_image_size( $this->file );
 		if ( ! $size ) {
 			return new WP_Error( 'invalid_image', __( 'Could not read image size.' ), $this->file );
 		}
@@ -412,6 +423,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' ) );
 		}
@@ -455,6 +470,11 @@ 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() );
+				}
 			default:
 				header( 'Content-Type: image/jpeg' );
 				return imagejpeg( $this->image, null, $this->get_quality() );
diff --git src/wp-includes/class-wp-image-editor-imagick.php src/wp-includes/class-wp-image-editor-imagick.php
index 5db6fc4a86..cf75dbeeb1 100644
--- src/wp-includes/class-wp-image-editor-imagick.php
+++ src/wp-includes/class-wp-image-editor-imagick.php
@@ -365,7 +365,7 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
 			}
 
 			// Set appropriate quality settings after resizing.
-			if ( 'image/jpeg' == $this->mime_type ) {
+			if ( 'image/jpeg' === $this->mime_type ) {
 				if ( is_callable( array( $this->image, 'unsharpMaskImage' ) ) ) {
 					$this->image->unsharpMaskImage( 0.25, 0.25, 8, 0.065 );
 				}
@@ -373,13 +373,17 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
 				$this->image->setOption( 'jpeg:fancy-upsampling', 'off' );
 			}
 
-			if ( 'image/png' === $this->mime_type ) {
+			elseif ( 'image/png' === $this->mime_type ) {
 				$this->image->setOption( 'png:compression-filter', '5' );
 				$this->image->setOption( 'png:compression-level', '9' );
 				$this->image->setOption( 'png:compression-strategy', '1' );
 				$this->image->setOption( 'png:exclude-chunk', 'all' );
 			}
 
+			elseif ( 'image/webp' === $this->mime_type ) {
+				$this->image->setOption( 'webp:emulate-jpeg-size', true );
+			}
+
 			/*
 			 * If alpha channel is not defined, set it opaque.
 			 *
@@ -666,6 +670,12 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
 		list( $filename, $extension, $mime_type ) = $this->get_output_format( null, $mime_type );
 
 		try {
+			// Render WebP previews as PNG to workaround possible segfault issues.
+			if ( 'image/webp' === $mime_type ) {
+				$extension = 'PNG';
+				$mime_type = 'image/png';
+			}
+
 			// Temporarily change format for stream
 			$this->image->setImageFormat( strtoupper( $extension ) );
 
diff --git src/wp-includes/class-wp-theme.php src/wp-includes/class-wp-theme.php
index 683065cd2f..81fff2091d 100644
--- src/wp-includes/class-wp-theme.php
+++ src/wp-includes/class-wp-theme.php
@@ -1078,7 +1078,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 7377a384c8..7029917568 100644
--- src/wp-includes/compat.php
+++ src/wp-includes/compat.php
@@ -505,3 +505,11 @@ endif;
 if ( ! function_exists( 'spl_autoload_register' ) ) {
 	require_once ABSPATH . WPINC . '/spl-autoload-compat.php';
 }
+
+// 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 );
+}
diff --git src/wp-includes/customize/class-wp-customize-media-control.php src/wp-includes/customize/class-wp-customize-media-control.php
index 338324fd36..2160b3a768 100644
--- src/wp-includes/customize/class-wp-customize-media-control.php
+++ src/wp-includes/customize/class-wp-customize-media-control.php
@@ -86,7 +86,7 @@ class WP_Customize_Media_Control extends WP_Customize_Control {
 			if ( $this->setting->default ) {
 				// Fake an attachment model - needs all fields used by template.
 				// Note that the default value must be a URL, NOT an attachment ID.
-				$type               = in_array( substr( $this->setting->default, -3 ), array( 'jpg', 'png', 'gif', 'bmp' ) ) ? 'image' : 'document';
+				$type               = preg_match( '/\.(bmp|gif|jpe?g|png|webp)$/i', $this->setting->default ) ? 'image' : 'document';
 				$default_attachment = array(
 					'id'    => 1,
 					'url'   => $this->setting->default,
diff --git src/wp-includes/deprecated.php src/wp-includes/deprecated.php
index 0b3ce28d33..fe1b5048d6 100644
--- src/wp-includes/deprecated.php
+++ src/wp-includes/deprecated.php
@@ -1923,7 +1923,7 @@ function get_attachment_icon( $id = 0, $fullsize = false, $max_dims = false ) {
 	// Do we need to constrain the image?
 	if ( ($max_dims = apply_filters('attachment_max_dims', $max_dims)) && file_exists($src_file) ) {
 
-		$imagesize = getimagesize($src_file);
+		$imagesize = wp_get_image_size($src_file);
 
 		if (($imagesize[0] > $max_dims[0]) || $imagesize[1] > $max_dims[1] ) {
 			$actual_aspect = $imagesize[0] / $imagesize[1];
@@ -3311,6 +3311,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;
 		}
 	} else {
 		switch( $mime_type ) {
@@ -3320,6 +3322,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 f9795fdaec..9a4b18f47d 100644
--- src/wp-includes/formatting.php
+++ src/wp-includes/formatting.php
@@ -3050,7 +3050,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 ) ) {
diff --git src/wp-includes/functions.php src/wp-includes/functions.php
index 7d41b37aef..56efdea78b 100644
--- src/wp-includes/functions.php
+++ src/wp-includes/functions.php
@@ -2407,6 +2407,7 @@ function wp_check_filetype_and_ext( $file, $filename, $mimes = null ) {
 					'image/gif'  => 'gif',
 					'image/bmp'  => 'bmp',
 					'image/tiff' => 'tif',
+					'image/webp' => 'webp',
 				)
 			);
 
@@ -2466,6 +2467,93 @@ function wp_check_filetype_and_ext( $file, $filename, $mimes = null ) {
 	return apply_filters( 'wp_check_filetype_and_ext', compact( 'ext', 'type', 'proper_filename' ), $file, $filename, $mimes );
 }
 
+/**
+ * Wrapper for getimagesize()
+ *
+ * The native PHP function might not support newer formats.
+ *
+ * @since 5.0
+ *
+ * @see {https://core.trac.wordpress.org/ticket/35725}
+ *
+ * @param string $file Full path to the file.
+ * @param array $info Additional metadata to pull.
+ * @return array|false An array containing width, height, type constant, attributes, and media type.
+ */
+function wp_get_image_size( $file, &$info = array() ) {
+	// Try getimagesize() first.
+	if ( false !== ( $info = @getimagesize( $file, $info ) ) ) {
+		return $info;
+	}
+
+	// Support for WebP did not land in getimagesize() until PHP 7.1. But that's OK,
+	// we can pull what we need from the file headers.
+	if ( 'image/webp' === wp_get_image_mime( $file ) ) {
+		try {
+			if ( $handle = fopen( $file, 'rb' ) ) {
+				$magic = fread( $handle, 40 );
+				fclose( $handle );
+
+				// Make sure we got enough bytes.
+				if ( strlen( $magic ) < 40 ) {
+					return false;
+				}
+
+				$width = $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,
+						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;
+	}
+}
+
 /**
  * Returns the real mime type of an image file.
  *
@@ -2492,6 +2580,22 @@ function wp_get_image_mime( $file ) {
 		} else {
 			$mime = false;
 		}
+
+		// WebP support took longer to land in Exif than GD.
+		if ( ! $mime ) {
+			if ( $handle = fopen( $file, 'rb' ) ) {
+				$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;
 	}
@@ -2528,6 +2632,7 @@ function wp_get_mime_types() {
 			'bmp'                          => 'image/bmp',
 			'tiff|tif'                     => 'image/tiff',
 			'ico'                          => 'image/x-icon',
+			'webp'                         => 'image/webp',
 			// Video formats.
 			'asf|asx'                      => 'video/x-ms-asf',
 			'wmv'                          => 'video/x-ms-wmv',
@@ -2646,7 +2751,7 @@ function wp_get_ext_types() {
 	 */
 	return apply_filters(
 		'ext2type', array(
-			'image'       => array( 'jpg', 'jpeg', 'jpe', 'gif', 'png', 'bmp', 'tif', 'tiff', 'ico' ),
+			'image'       => array( 'jpg', 'jpeg', 'jpe', 'gif', 'png', 'bmp', 'tif', 'tiff', 'ico', '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 1e6a4e5f58..ca9d592d34 100644
--- src/wp-includes/media.php
+++ src/wp-includes/media.php
@@ -227,7 +227,7 @@ function image_downsize( $id, $size = 'medium' ) {
 		$is_intermediate = true;
 	} elseif ( $size == 'thumbnail' ) {
 		// fall back to the old thumbnail
-		if ( ( $thumb_file = wp_get_attachment_thumb_file( $id ) ) && $info = getimagesize( $thumb_file ) ) {
+		if ( ( $thumb_file = wp_get_attachment_thumb_file( $id ) ) && $info = wp_get_image_size( $thumb_file ) ) {
 			$img_url         = str_replace( $img_url_basename, wp_basename( $thumb_file ), $img_url );
 			$width           = $info[0];
 			$height          = $info[1];
@@ -832,7 +832,7 @@ function wp_get_attachment_image_src( $attachment_id, $size = 'thumbnail', $icon
 			$icon_dir = apply_filters( 'icon_dir', ABSPATH . WPINC . '/images/media' );
 
 			$src_file                = $icon_dir . '/' . wp_basename( $src );
-			@list( $width, $height ) = getimagesize( $src_file );
+			@list( $width, $height ) = wp_get_image_size( $src_file );
 		}
 
 		if ( $src && $width && $height ) {
diff --git src/wp-includes/post.php src/wp-includes/post.php
index 1796ddeded..7083060845 100644
--- src/wp-includes/post.php
+++ src/wp-includes/post.php
@@ -5503,7 +5503,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 );
 
 		case 'audio':
@@ -5607,7 +5607,7 @@ function wp_mime_type_icon( $mime = 0 ) {
 						if ( substr( $file, 0, 1 ) == '.' ) {
 							continue;
 						}
-						if ( ! in_array( strtolower( substr( $file, -4 ) ), array( '.png', '.gif', '.jpg' ) ) ) {
+						if ( ! preg_match( '/\.(gif|jpe?g|png|webp)$/i', $file ) ) {
 							if ( is_dir( "$dir/$file" ) ) {
 								$dirs[ "$dir/$file" ] = "$uri/$file";
 							}
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 d9e3d5fbb8..d23b4bd4ed 100644
--- tests/phpunit/tests/functions.php
+++ tests/phpunit/tests/functions.php
@@ -1106,6 +1106,30 @@ class Tests_Functions extends WP_UnitTestCase {
 		$this->assertEquals( $expected, wp_get_image_mime( $file ) );
 	}
 
+	/**
+	 * @ticket 35725
+	 * @dataProvider _wp_get_image_size
+	 */
+	public function test_wp_get_image_size( $file, $expected ) {
+		if ( ! is_callable( 'exif_imagetype' ) && ! function_exists( 'getimagesize' ) ) {
+			$this->markTestSkipped( 'The exif PHP extension is not loaded.' );
+		}
+
+		$result = wp_get_image_size( $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
@@ -1203,6 +1227,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_get_image_size();
+	 */
+	public function _wp_get_image_size() {
+		$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/functions.php tests/phpunit/tests/image/functions.php
index f36fe6fdc6..2c0254c27d 100644
--- tests/phpunit/tests/image/functions.php
+++ tests/phpunit/tests/image/functions.php
@@ -59,6 +59,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',
 		);
 
 		foreach ( $files as $file ) {
@@ -85,6 +89,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',
 		);
 
 		foreach ( $files as $file ) {
@@ -130,6 +138,7 @@ class Tests_Image_Functions extends WP_UnitTestCase {
 			'image/jpeg',
 			'image/gif',
 			'image/png',
+			'image/webp',
 		);
 
 		// Test each image editor engine
@@ -222,6 +231,7 @@ class Tests_Image_Functions extends WP_UnitTestCase {
 			'jpe'  => 'image/jpeg',
 			'gif'  => 'image/gif',
 			'png'  => 'image/png',
+			'webp' => 'image/webp',
 			'unk'  => 'image/jpeg', // Default, unknown
 		);
 
