Skip to content

Commit

Permalink
Fix 'PHP Fatal error: Uncaught Error: Call to undefined method WP_Ima…
Browse files Browse the repository at this point in the history
…ge_Editor_Imagick::get_error_message()'
  • Loading branch information
A5hleyRich committed Aug 13, 2017
1 parent 00c76f1 commit 5527baa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions includes/class-ipq-process.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ protected function task( $item ) {
throw new IPQ_Process_Exception( 'Unable to get WP_Image_Editor for file "' . $img_path . '": ' . $editor->get_error_message() . ' (is GD or ImageMagick installed?)' );
}

if ( is_wp_error( $editor->resize( $width, $height, $crop ) ) ) {
throw new IPQ_Process_Exception( 'Error resizing image: ' . $editor->get_error_message() );
$resize = $editor->resize( $width, $height, $crop );

if ( is_wp_error( $resize ) ) {
throw new IPQ_Process_Exception( 'Error resizing image: ' . $resize->get_error_message() );
}

$resized_file = $editor->save();
Expand Down

0 comments on commit 5527baa

Please sign in to comment.