Make WordPress Core

Ticket #36534: 36534.diff

File 36534.diff, 859 bytes (added by joemcgill, 9 years ago)
  • src/wp-includes/class-wp-image-editor-imagick.php

    diff --git src/wp-includes/class-wp-image-editor-imagick.php src/wp-includes/class-wp-image-editor-imagick.php
    index 74ba793..8355720 100644
    class WP_Image_Editor_Imagick extends WP_Image_Editor { 
    6868                        'setimagecompressionquality',
    6969                        'setimagepage',
    7070                        'setoption',
     71                        'setresourcelimit',
    7172                        'scaleimage',
    7273                        'cropimage',
    7374                        'rotateimage',
    class WP_Image_Editor_Imagick extends WP_Image_Editor { 
    157158                        return new WP_Error( 'invalid_image', $e->getMessage(), $this->file );
    158159                }
    159160
     161                // Limit Imagick to only use 1 thread to avoid memory issues with OpenMP
     162                $this->image->setResourceLimit( 6, 1 );
     163
    160164                $updated_size = $this->update_size();
    161165                if ( is_wp_error( $updated_size ) ) {
    162166                        return $updated_size;