Make WordPress Core

Changeset 56250

Timestamp:
07/17/2023 08:02:11 PM (13 months ago)
Author:
azaozz
Message:

Media: Stop using and deprecate set_imagick_time_limit(). Seems it causes more problems than it solves.

Follow-up to #52569 and [55404].

Props: dsar, antpb, audrasjb, SergeyBiryukov, hberberoglu, mtxz, densityapps, ekazda, matt_fw, soulseekah, mikeschroder, azaozz.

Fixes: #58202.

File:
1 edited

Legend:

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

    r56204 r56250  
    269269     * point 1 above by aligning Imagick's timeout with PHP's timeout, assuming it is set.
    270270     *
     271
     272
     273
    271274     * Note:
    272275     *  - Imagick resource exhaustion does not issue catchable exceptions (yet).
     
    276279     *
    277280     * @since 6.2.0
     281
    278282     *
    279283     * @return int|null The new limit on success, null on failure.
    280284     */
    281285    public static function set_imagick_time_limit() {
     286
     287
    282288        if ( ! defined( 'Imagick::RESOURCETYPE_TIME' ) ) {
    283289            return null;
     
    329335            return $this->crop( $src_x, $src_y, $src_w, $src_h, $dst_w, $dst_h );
    330336        }
    331 
    332         self::set_imagick_time_limit();
    333337
    334338        // Execute the resize.
     
    598602        }
    599603
    600         self::set_imagick_time_limit();
    601 
    602604        try {
    603605            $this->image->cropImage( $src_w, $src_h, $src_x, $src_y );
Note: See TracChangeset for help on using the changeset viewer.