Property | Type | Description | |
---|---|---|---|
$image | Imagick | Imagick object. |
Method | Description | |
---|---|---|
__destruct ( ) | ||
crop ( integer $src_x, integer $src_y, integer $src_w, integer $src_h, integer $dst_w = null, integer $dst_h = null, boolean $src_abs = false ) : boolean | WP_Error | Crops Image. | |
flip ( boolean $horz, boolean $vert ) : true | WP_Error | Flips current image. | |
load ( ) : true | WP_Error | Loads image from $this->file into new Imagick Object. | |
multi_resize ( array $sizes ) : array | Resize multiple images from a single source. | |
resize ( integer | null $max_w, integer | null $max_h, boolean $crop = false ) : boolean | WP_Error | Resizes current image. | |
rotate ( float $angle ) : true | WP_Error | Rotates current image counter-clockwise by $angle. | |
save ( string $destfilename = null, string $mime_type = null ) : array | WP_Error | Saves current image to file. | |
set_quality ( integer $quality = null ) : true | WP_Error | Sets Image Compression quality on a 1-100% scale. | |
stream ( string $mime_type = null ) : true | WP_Error | Streams current image to browser. | |
supports_mime_type ( string $mime_type ) : boolean | Checks to see if editor supports the mime-type specified. | |
test ( array $args = [] ) : boolean | Checks to see if current environment supports Imagick. |
Method | Description | |
---|---|---|
_save ( Imagick $image, string $filename = null, string $mime_type = null ) : array | WP_Error | ||
pdf_setup ( ) : string | WP_Error | Sets up Imagick for PDF processing. | |
strip_meta ( ) : true | WP_Error | Strips all image meta except color profiles from an image. | |
thumbnail_image ( integer $dst_w, integer $dst_h, string $filter_name = 'FILTER_TRIANGLE', boolean $strip_meta = true ) : boolean | WP_Error | Efficiently resize the current image | |
update_size ( integer $width = null, integer $height = null ) : true | WP_Error | Sets or updates current image size. |
public crop ( integer $src_x, integer $src_y, integer $src_w, integer $src_h, integer $dst_w = null, integer $dst_h = null, boolean $src_abs = false ) : boolean | WP_Error | ||
$src_x | integer | The start x position to crop from. |
$src_y | integer | The start y position to crop from. |
$src_w | integer | The width to crop. |
$src_h | integer | The height to crop. |
$dst_w | integer | Optional. The destination width. |
$dst_h | integer | Optional. The destination height. |
$src_abs | boolean | Optional. If the source crop points are absolute. |
return | boolean | WP_Error |
public load ( ) : true | WP_Error | ||
return | true | WP_Error | True if loaded; WP_Error on failure. |
public multi_resize ( array $sizes ) : array | ||
$sizes | array | { An array of image size arrays. Default sizes are 'small', 'medium', 'medium_large', 'large'. Either a height or width must be provided. If one of the two is set to null, the resize will maintain aspect ratio according to the provided dimension. @type array $size { Array of height, width values, and whether to crop. @type int $width Image width. Optional if `$height` is specified. @type int $height Image height. Optional if `$width` is specified. @type bool $crop Optional. Whether to crop the image. Default false. } } |
return | array | An array of resized images' metadata by size. |
public set_quality ( integer $quality = null ) : true | WP_Error | ||
$quality | integer | Compression Quality. Range: [1,100] |
return | true | WP_Error | True if set successfully; WP_Error on failure. |
protected strip_meta ( ) : true | WP_Error | ||
return | true | WP_Error | True if stripping metadata was successful. WP_Error object on error. |
public static supports_mime_type ( string $mime_type ) : boolean | ||
$mime_type | string | |
return | boolean |
protected thumbnail_image ( integer $dst_w, integer $dst_h, string $filter_name = 'FILTER_TRIANGLE', boolean $strip_meta = true ) : boolean | WP_Error | ||
$dst_w | integer | The destination width. |
$dst_h | integer | The destination height. |
$filter_name | string | Optional. The Imagick filter to use when resizing. Default 'FILTER_TRIANGLE'. |
$strip_meta | boolean | Optional. Strip all profiles, excluding color profiles, from the image. Default true. |
return | boolean | WP_Error |
protected update_size ( integer $width = null, integer $height = null ) : true | WP_Error | ||
$width | integer | |
$height | integer | |
return | true | WP_Error |