Make WordPress Core


Ignore:
Timestamp:
09/19/2022 10:51:53 PM (18 months ago)
Author:
davidbaumwald
Message:

Media: Revert WebP generation.

Given Matt's recent post about removing WebP from core and possibly implementing the feature in a future Canonical Plugin, this change reverts changesets [54086], [54094], and [54097]. Additionally, [54210] contained a coding standards follow-up in one of the affected files that is no longer needed.

Reverts [54086], [54094], and [54097].

Props SergeyBiryukov.
See #55443.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-image-editor-imagick.php

    r54097 r54226  
    439439     *
    440440     * @param array $sizes {
    441      *     Associative array of image size names and their data.
     441     *     An array of image size data arrays.
    442442     *
    443443     *     Either a height or width must be provided.
     
    459459
    460460        foreach ( $sizes as $size => $size_data ) {
    461             // Include size name in the data.
    462             $size_data['name'] = $size;
    463 
    464461            $meta = $this->make_subsize( $size_data );
    465462
     
    476473     *
    477474     * @since 5.3.0
    478      * @since 6.1.0 The $sizes parameter may now include a $name key for each entry.
    479475     *
    480476     * @param array $size_data {
    481477     *     Array of size data.
    482478     *
    483      *     @type int    $width  The maximum width in pixels.
    484      *     @type int    $height The maximum height in pixels.
    485      *     @type bool   $crop   Whether to crop the image to exact dimensions.
    486      *     @type string $name   Image size name.
     479     *     @type int  $width  The maximum width in pixels.
     480     *     @type int  $height The maximum height in pixels.
     481     *     @type bool $crop   Whether to crop the image to exact dimensions.
    487482     * }
    488483     * @return array|WP_Error The image data array for inclusion in the `sizes` array in the image meta,
     
    494489        }
    495490
    496         $orig_size      = $this->size;
    497         $orig_size_name = $this->size_name;
    498         $orig_image     = $this->image->getImage();
     491        $orig_size  = $this->size;
     492        $orig_image = $this->image->getImage();
    499493
    500494        if ( ! isset( $size_data['width'] ) ) {
     
    508502        if ( ! isset( $size_data['crop'] ) ) {
    509503            $size_data['crop'] = false;
    510         }
    511 
    512         if ( isset( $size_data['name'] ) ) {
    513             $this->update_size_name( $size_data['name'] );
    514504        }
    515505
     
    526516        }
    527517
    528         $this->size      = $orig_size;
    529         $this->size_name = $orig_size_name;
    530         $this->image     = $orig_image;
     518        $this->size  = $orig_size;
     519        $this->image = $orig_image;
    531520
    532521        if ( ! is_wp_error( $saved ) ) {
Note: See TracChangeset for help on using the changeset viewer.