Changeset 22817 for trunk/wp-includes/class-wp-image-editor-imagick.php
- Timestamp:
- 11/22/2012 09:52:16 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class-wp-image-editor-imagick.php
r22619 r22817 16 16 */ 17 17 class WP_Image_Editor_Imagick extends WP_Image_Editor { 18 18 19 protected $image = null; // Imagick Object 19 20 … … 37 38 * @return boolean 38 39 */ 39 public static function test( $args = null) {40 public static function test( $args = array() ) { 40 41 if ( ! extension_loaded( 'imagick' ) || ! is_callable( 'Imagick', 'queryFormats' ) ) 41 42 return false; … … 45 46 46 47 /** 48 * Checks to see if editor supports the mime-type specified. 49 * 50 * @since 3.5.0 51 * @access public 52 * 53 * @param string $mime_type 54 * @return boolean 55 */ 56 public static function supports_mime_type( $mime_type ) { 57 $imagick_extension = strtoupper( self::get_extension( $mime_type ) ); 58 59 if ( ! $imagick_extension ) 60 return false; 61 62 try { 63 return ( (bool) Imagick::queryFormats( $imagick_extension ) ); 64 } 65 catch ( Exception $e ) { 66 return false; 67 } 68 } 69 70 /** 47 71 * Loads image from $this->file into new Imagick Object. 48 72 * … … 52 76 * @return boolean|WP_Error True if loaded; WP_Error on failure. 53 77 */ 54 p rotectedfunction load() {78 public function load() { 55 79 if ( $this->image ) 56 80 return true; … … 136 160 137 161 return parent::update_size( $width, $height ); 138 }139 140 /**141 * Checks to see if editor supports the mime-type specified.142 *143 * @since 3.5.0144 * @access public145 *146 * @param string $mime_type147 * @return boolean148 */149 public static function supports_mime_type( $mime_type ) {150 if ( ! $mime_type )151 return false;152 153 $imagick_extension = strtoupper( self::get_extension( $mime_type ) );154 155 try {156 return ( (bool) Imagick::queryFormats( $imagick_extension ) );157 }158 catch ( Exception $e ) {159 return false;160 }161 162 } 162 163 … … 313 314 * @access public 314 315 * 315 * @param boolean $horz Horizon al Flip316 * @param boolean $horz Horizontal Flip 316 317 * @param boolean $vert Vertical Flip 317 318 * @returns boolean|WP_Error
Note: See TracChangeset
for help on using the changeset viewer.