Increase the PHP memory_limit to WP_MAX_MEMORY_LIMIT in WP_Image_Editor_Imagick.

Props DH-Shredder
fixes #22699


git-svn-id: http://core.svn.wordpress.org/trunk@22997 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Ryan Boren 2012-12-03 19:44:58 +00:00
parent 9ba411d918
commit 63539ff739
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 );