Make WordPress Core


Ignore:
Timestamp:
02/12/2024 11:24:19 PM (8 months ago)
Author:
adamsilverstein
Message:

Media: enable control of progressive image output.

Add a new image_save_progressive filter which developers can use to control whether intermediate image sizes are saved in a progressive format (when available). By default, progressive image output is not used, matching the previous behavior.

Props: adamsilverstein, _ck_, markoheijnen, SergeyBiryukov, Japh, pmeenan, mikeschroder, derekspringer, buley, ericlewis, bahia0019, born2webdesign.
Fixes #21668.

File:
1 edited

Legend:

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

    r57524 r57607  
    503503        if ( ! $filename ) {
    504504            $filename = $this->generate_filename( null, null, $extension );
     505        }
     506
     507        if ( function_exists( 'imageinterlace' ) ) {
     508            /** This filter is documented in wp-includes/class-wp-image-editor-imagick.php */
     509            imageinterlace( $image, apply_filters( 'image_save_progressive', false, $mime_type ) );
    505510        }
    506511
Note: See TracChangeset for help on using the changeset viewer.