WP_Image_Editor_Imagick::save( string $destfilename = null, string $mime_type = null )
Saves current image to file.
Description Description
Parameters Parameters
- $destfilename
-
(string) (Optional)
Default value: null
- $mime_type
-
(string) (Optional)
Default value: null
Return Return
(array|WP_Error) 'path'=>string, 'file'=>string, 'width'=>int, 'height'=>int, 'mime-type'=>string
Source Source
File: wp-includes/class-wp-image-editor-imagick.php
public function save( $destfilename = null, $mime_type = null ) { $saved = $this->_save( $this->image, $destfilename, $mime_type ); if ( ! is_wp_error( $saved ) ) { $this->file = $saved['path']; $this->mime_type = $saved['mime-type']; try { $this->image->setImageFormat( strtoupper( $this->get_extension( $this->mime_type ) ) ); } catch ( Exception $e ) { return new WP_Error( 'image_save_error', $e->getMessage(), $this->file ); } } return $saved; }
Expand full source code Collapse full source code View on Trac
Changelog Changelog
Version | Description |
---|---|
3.5.0 | Introduced. |