diff --git a/src/wp-includes/class-wp-image-editor-imagick.php b/src/wp-includes/class-wp-image-editor-imagick.php index feb19d3507e85..756fcce894a1d 100644 --- a/src/wp-includes/class-wp-image-editor-imagick.php +++ b/src/wp-includes/class-wp-image-editor-imagick.php @@ -268,6 +268,9 @@ protected function update_size( $width = null, $height = null ) { * This function, which is expected to be run before heavy image routines, resolves * point 1 above by aligning Imagick's timeout with PHP's timeout, assuming it is set. * + * However seems it introduces more problems than it fixes, + * see https://core.trac.wordpress.org/ticket/58202. + * * Note: * - Imagick resource exhaustion does not issue catchable exceptions (yet). * See https://github.com/Imagick/imagick/issues/333. @@ -275,10 +278,13 @@ protected function update_size( $width = null, $height = null ) { * image operations within the time of the HTTP request. * * @since 6.2.0 + * @since 6.3.0 This method was deprecated. * * @return int|null The new limit on success, null on failure. */ public static function set_imagick_time_limit() { + _deprecated_function( __METHOD__, '6.3.0' ); + if ( ! defined( 'Imagick::RESOURCETYPE_TIME' ) ) { return null; } @@ -329,8 +335,6 @@ public function resize( $max_w, $max_h, $crop = false ) { return $this->crop( $src_x, $src_y, $src_w, $src_h, $dst_w, $dst_h ); } - self::set_imagick_time_limit(); - // Execute the resize. $thumb_result = $this->thumbnail_image( $dst_w, $dst_h ); if ( is_wp_error( $thumb_result ) ) { @@ -597,8 +601,6 @@ public function crop( $src_x, $src_y, $src_w, $src_h, $dst_w = null, $dst_h = nu $src_h -= $src_y; } - self::set_imagick_time_limit(); - try { $this->image->cropImage( $src_w, $src_h, $src_x, $src_y ); $this->image->setImagePage( $src_w, $src_h, 0, 0 );