WordPress at a glance
function is not described

WP_Image_Editor_Imagick::_save() WP 1.0

This is a method of the class: WP_Image_Editor_Imagick

Hooks from the method
Return

Array/WP_Error.

Usage

$WP_Image_Editor_Imagick = new WP_Image_Editor_Imagick();
$var = $WP_Image_Editor_Imagick->_save( $image, $filename, $mime_type );
$image(Imagick) (required)
$filename(string)

Default: null
$mime_type(string)

Default: null

Code of WP Image Editor Imagick:: save: wp-includes/class-wp-image-editor-imagick.php WP 5.3.2

<?php
protected function _save( $image, $filename = null, $mime_type = null ) {
	list( $filename, $extension, $mime_type ) = $this->get_output_format( $filename, $mime_type );

	if ( ! $filename ) {
		$filename = $this->generate_filename( null, null, $extension );
	}

	try {
		// Store initial Format
		$orig_format = $this->image->getImageFormat();

		$this->image->setImageFormat( strtoupper( $this->get_extension( $mime_type ) ) );
		$this->make_image( $filename, array( $image, 'writeImage' ), array( $filename ) );

		// Reset original Format
		$this->image->setImageFormat( $orig_format );
	} catch ( Exception $e ) {
		return new WP_Error( 'image_save_error', $e->getMessage(), $filename );
	}

	// Set correct file permissions
	$stat  = stat( dirname( $filename ) );
	$perms = $stat['mode'] & 0000666; //same permissions as parent folder, strip off the executable bits
	chmod( $filename, $perms );

	return array(
		'path'      => $filename,
		/** This filter is documented in wp-includes/class-wp-image-editor-gd.php */
		'file'      => wp_basename( apply_filters( 'image_make_intermediate_size', $filename ) ),
		'width'     => $this->size['width'],
		'height'    => $this->size['height'],
		'mime-type' => $mime_type,
	);
}