WordPress.org

Make WordPress Core


Ignore:
Timestamp:
05/04/2021 02:43:36 PM (7 months ago)
Author:
adamsilverstein
Message:

Images: enable WebP support.

Add support for uploading, editing and saving WebP images when supported by the server.

Add 'image/webp' to supported mime types. Correctly identify WebP images and sizes even when PHP doesn't support WebP. Resize uploaded WebP files (when supported) and use for front end markup.

Props markoheijne, blobfolio, Clorith, joemcgill, atjn, desrosj, spacedmonkey, marylauc, mikeschroder, hellofromtonya, flixos90.
Fixes #35725.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/deprecated.php

    r50146 r50810  
    33413341            case 'image/gif':
    33423342                return (imagetypes() & IMG_GIF) != 0;
     3343            case 'image/webp':
     3344                return (imagetypes() & IMG_WEBP) != 0; // phpcs:ignore PHPCompatibility.Constants.NewConstants.img_webpFound
    33433345        }
    33443346    } else {
     
    33503352            case 'image/gif':
    33513353                return function_exists('imagecreatefromgif');
     3354            case 'image/webp':
     3355                return function_exists('imagecreatefromwebp');
    33523356        }
    33533357    }
Note: See TracChangeset for help on using the changeset viewer.