diff --git wp-admin/includes/image-edit.php wp-admin/includes/image-edit.php
diff --git wp-includes/class-wp-image-editor-imagick.php wp-includes/class-wp-image-editor-imagick.php
index d29fefd..d7b450f 100644
|
|
|
class WP_Image_Editor_Imagick extends WP_Image_Editor { |
| 39 | 39 | */ |
| 40 | 40 | public static function test( $args = array() ) { |
| 41 | 41 | |
| | 42 | // First, test Imagick's extension and classes. |
| | 43 | if ( ! extension_loaded( 'imagick' ) || ! class_exists( 'Imagick' ) || ! class_exists( 'ImagickPixel' ) ) |
| | 44 | return false; |
| | 45 | |
| 42 | 46 | $required_methods = array( |
| 43 | 47 | 'clear', |
| 44 | 48 | 'destroy', |
| … |
… |
class WP_Image_Editor_Imagick extends WP_Image_Editor { |
| 59 | 63 | 'flopimage', |
| 60 | 64 | ); |
| 61 | 65 | |
| 62 | | // Check for requirements |
| 63 | | if ( ! extension_loaded( 'imagick' ) || |
| 64 | | ! class_exists( 'Imagick' ) || |
| 65 | | ! is_callable( 'Imagick', 'queryFormats' ) || |
| 66 | | ! class_exists( 'ImagickPixel' ) || |
| | 66 | // Now, test for deep requirements within Imagick. |
| | 67 | if ( ! is_callable( 'Imagick', 'queryFormats' ) || |
| 67 | 68 | ! defined( 'imagick::COMPRESSION_JPEG' ) || |
| 68 | 69 | array_diff( $required_methods, get_class_methods( 'Imagick' ) ) ) { |
| 69 | 70 | |
| 70 | 71 | return false; |
| 71 | 72 | } |
| 72 | 73 | |
| 73 | | /** |
| 74 | | * setIteratorIndex is optional unless mime is an animated format. |
| 75 | | * Here, we just say no if a user is attempting to |
| 76 | | * edit a GIF and setIteratorIndex isn't available. |
| 77 | | */ |
| 78 | | if ( ( ! isset( $args['mime_type'] ) || $args['mime_type'] == 'image/gif' ) && |
| 79 | | ! method_exists( 'Imagick', 'setIteratorIndex' ) ) { |
| 80 | | |
| 81 | | return false; |
| 82 | | } |
| 83 | | |
| 84 | 74 | return true; |
| 85 | 75 | } |
| 86 | 76 | |
| … |
… |
class WP_Image_Editor_Imagick extends WP_Image_Editor { |
| 99 | 89 | if ( ! $imagick_extension ) |
| 100 | 90 | return false; |
| 101 | 91 | |
| | 92 | // setIteratorIndex is optional unless mime is an animated format. |
| | 93 | // Here, we just say no if you are missing it and aren't loading a jpeg. |
| | 94 | if ( ! method_exists( 'Imagick', 'setIteratorIndex' ) && $mime_type != 'image/jpeg' ) |
| | 95 | return false; |
| | 96 | |
| 102 | 97 | try { |
| 103 | 98 | return ( (bool) Imagick::queryFormats( $imagick_extension ) ); |
| 104 | 99 | } |