Increase the PHP memory_limit to WP_MAX_MEMORY_LIMIT in WP_Image_Editor_Imagick.

Props DH-Shredder
fixes #22699


git-svn-id: https://develop.svn.wordpress.org/trunk@22997 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2012-12-03 19:44:58 +00:00
parent 4acd3d7db8
commit ecb18ffc05
1 changed files with 3 additions and 0 deletions

View File

@ -119,6 +119,9 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
if ( ! is_file( $this->file ) && ! preg_match( '|^https?://|', $this->file ) )
return new WP_Error( 'error_loading_image', __('File doesn’t exist?'), $this->file );
// Even though Imagick uses less PHP memory than GD, set higher limit for users that have low PHP.ini limits
@ini_set( 'memory_limit', apply_filters( 'image_memory_limit', WP_MAX_MEMORY_LIMIT ) );
try {
$this->image = new Imagick( $this->file );