diff --git src/wp-includes/class-wp-image-editor-gd.php src/wp-includes/class-wp-image-editor-gd.php
index de079357fb..b7424f29df 100644
|
|
class WP_Image_Editor_GD extends WP_Image_Editor { |
491 | 491 | if ( ! $filename ) { |
492 | 492 | $filename = $this->generate_filename( null, null, $extension ); |
493 | 493 | } |
| 494 | if ( function_exists( 'imageinterlace' ) ) { |
| 495 | /** This filter is documented in wp-includes/class-wp-image-editor-imagick.php */ |
| 496 | imageinterlace( $image, apply_filters( 'image_save_progressive', false, $mime_type ) ); |
| 497 | } |
494 | 498 | |
495 | 499 | if ( 'image/gif' === $mime_type ) { |
496 | 500 | if ( ! $this->make_image( $filename, 'imagegif', array( $image, $filename ) ) ) { |
diff --git src/wp-includes/class-wp-image-editor-imagick.php src/wp-includes/class-wp-image-editor-imagick.php
index 03fe0bca69..281b838b4c 100644
|
|
class WP_Image_Editor_Imagick extends WP_Image_Editor { |
478 | 478 | $this->image->setImageDepth( 8 ); |
479 | 479 | } |
480 | 480 | } |
481 | | |
482 | | if ( is_callable( array( $this->image, 'setInterlaceScheme' ) ) && defined( 'Imagick::INTERLACE_NO' ) ) { |
483 | | $this->image->setInterlaceScheme( Imagick::INTERLACE_NO ); |
484 | | } |
485 | 481 | } catch ( Exception $e ) { |
486 | 482 | return new WP_Error( 'image_resize_error', $e->getMessage() ); |
487 | 483 | } |
… |
… |
class WP_Image_Editor_Imagick extends WP_Image_Editor { |
814 | 810 | return new WP_Error( 'image_save_error', $e->getMessage(), $filename ); |
815 | 811 | } |
816 | 812 | |
| 813 | if ( method_exists( $this->image, 'setInterlaceScheme' ) && defined( 'Imagick::INTERLACE_PLANE' ) ) { |
| 814 | /** |
| 815 | * Filters whether to use output interlaced (progressive) images. |
| 816 | * |
| 817 | * @since 6.5.0 |
| 818 | * |
| 819 | * @param bool $interlace Whether to use interlaced images. Default false. |
| 820 | * @param string $mime_type The mime type being saved. |
| 821 | */ |
| 822 | if( apply_filters( 'image_save_progressive', false, $mime_type ) ) { |
| 823 | $this->image->setInterlaceScheme( Imagick::INTERLACE_NONE ); |
| 824 | } else { |
| 825 | $this->image->setInterlaceScheme( Imagick::INTERLACE_PLANE ); |
| 826 | } |
| 827 | |
817 | 828 | $write_image_result = $this->write_image( $this->image, $filename ); |
818 | 829 | if ( is_wp_error( $write_image_result ) ) { |
819 | 830 | return $write_image_result; |