mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-05 07:58:35 +01:00
Docs: Revisit the canonical location for the image_save_progressive
filter.
This aims to bring consistency with the `image_make_intermediate_size` filter, which has the main DocBlock in `WP_Image_Editor_GD::_save()` and a duplicate hook reference in `WP_Image_Editor_Imagick::_save()`. Follow-up to [57607]. See #21668. Built from https://develop.svn.wordpress.org/trunk@57614 git-svn-id: http://core.svn.wordpress.org/trunk@57115 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
c2558a5eaa
commit
f361c6f157
@ -505,7 +505,14 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( function_exists( 'imageinterlace' ) ) {
|
if ( function_exists( 'imageinterlace' ) ) {
|
||||||
/** This filter is documented in wp-includes/class-wp-image-editor-imagick.php */
|
/**
|
||||||
|
* Filters whether to output progressive images (if available).
|
||||||
|
*
|
||||||
|
* @since 6.5.0
|
||||||
|
*
|
||||||
|
* @param bool $interlace Whether to use progressive images for output if available. Default false.
|
||||||
|
* @param string $mime_type The mime type being saved.
|
||||||
|
*/
|
||||||
imageinterlace( $image, apply_filters( 'image_save_progressive', false, $mime_type ) );
|
imageinterlace( $image, apply_filters( 'image_save_progressive', false, $mime_type ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -821,16 +821,13 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
|
|||||||
return new WP_Error( 'image_save_error', $e->getMessage(), $filename );
|
return new WP_Error( 'image_save_error', $e->getMessage(), $filename );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( method_exists( $this->image, 'setInterlaceScheme' ) && method_exists( $this->image, 'getInterlaceScheme' ) && defined( 'Imagick::INTERLACE_PLANE' ) ) {
|
if ( method_exists( $this->image, 'setInterlaceScheme' )
|
||||||
|
&& method_exists( $this->image, 'getInterlaceScheme' )
|
||||||
|
&& defined( 'Imagick::INTERLACE_PLANE' )
|
||||||
|
) {
|
||||||
$orig_interlace = $this->image->getInterlaceScheme();
|
$orig_interlace = $this->image->getInterlaceScheme();
|
||||||
/**
|
|
||||||
* Filters whether to output progressive images (if available).
|
/** This filter is documented in wp-includes/class-wp-image-editor-imagick.php */
|
||||||
*
|
|
||||||
* @since 6.5.0
|
|
||||||
*
|
|
||||||
* @param bool $interlace Whether to use progressive images for output if available. Default false.
|
|
||||||
* @param string $mime_type The mime type being saved.
|
|
||||||
*/
|
|
||||||
if ( apply_filters( 'image_save_progressive', false, $mime_type ) ) {
|
if ( apply_filters( 'image_save_progressive', false, $mime_type ) ) {
|
||||||
$this->image->setInterlaceScheme( Imagick::INTERLACE_PLANE ); // True - line interlace output.
|
$this->image->setInterlaceScheme( Imagick::INTERLACE_PLANE ); // True - line interlace output.
|
||||||
} else {
|
} else {
|
||||||
@ -846,6 +843,7 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
|
|||||||
try {
|
try {
|
||||||
// Reset original format.
|
// Reset original format.
|
||||||
$this->image->setImageFormat( $orig_format );
|
$this->image->setImageFormat( $orig_format );
|
||||||
|
|
||||||
if ( isset( $orig_interlace ) ) {
|
if ( isset( $orig_interlace ) ) {
|
||||||
$this->image->setInterlaceScheme( $orig_interlace );
|
$this->image->setInterlaceScheme( $orig_interlace );
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '6.5-alpha-57613';
|
$wp_version = '6.5-alpha-57614';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user