PHP 클래스 WP_Image_Editor_Imagick, wordpress

부터: 3.5.0
상속: extends WP_Image_Editor
파일 보기 프로젝트 열기: johnpbloch/wordpress 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$image Imagick Imagick object.

공개 메소드들

메소드 설명
__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.

보호된 메소드들

메소드 설명
_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.

메소드 상세

__destruct() 공개 메소드

public __destruct ( )

_save() 보호된 메소드

protected _save ( Imagick $image, string $filename = null, string $mime_type = null ) : array | WP_Error
$image Imagick
$filename string
$mime_type string
리턴 array | WP_Error

crop() 공개 메소드

Crops Image.
부터: 3.5.0
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.
리턴 boolean | WP_Error

flip() 공개 메소드

Flips current image.
부터: 3.5.0
public flip ( boolean $horz, boolean $vert ) : true | WP_Error
$horz boolean Flip along Horizontal Axis
$vert boolean Flip along Vertical Axis
리턴 true | WP_Error

load() 공개 메소드

Loads image from $this->file into new Imagick Object.
부터: 3.5.0
public load ( ) : true | WP_Error
리턴 true | WP_Error True if loaded; WP_Error on failure.

multi_resize() 공개 메소드

Resize multiple images from a single source.
부터: 3.5.0
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. } }
리턴 array An array of resized images' metadata by size.

pdf_setup() 보호된 메소드

Increases rendering DPI and only loads first page.
부터: 4.7.0
protected pdf_setup ( ) : string | WP_Error
리턴 string | WP_Error File to load or WP_Error on failure.

resize() 공개 메소드

At minimum, 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.
부터: 3.5.0
public resize ( integer | null $max_w, integer | null $max_h, boolean $crop = false ) : boolean | WP_Error
$max_w integer | null Image width.
$max_h integer | null Image height.
$crop boolean
리턴 boolean | WP_Error

rotate() 공개 메소드

Rotates current image counter-clockwise by $angle.
부터: 3.5.0
public rotate ( float $angle ) : true | WP_Error
$angle float
리턴 true | WP_Error

save() 공개 메소드

Saves current image to file.
부터: 3.5.0
public save ( string $destfilename = null, string $mime_type = null ) : array | WP_Error
$destfilename string
$mime_type string
리턴 array | WP_Error {'path'=>string, 'file'=>string, 'width'=>int, 'height'=>int, 'mime-type'=>string}

set_quality() 공개 메소드

Sets Image Compression quality on a 1-100% scale.
부터: 3.5.0
public set_quality ( integer $quality = null ) : true | WP_Error
$quality integer Compression Quality. Range: [1,100]
리턴 true | WP_Error True if set successfully; WP_Error on failure.

stream() 공개 메소드

Streams current image to browser.
부터: 3.5.0
public stream ( string $mime_type = null ) : true | WP_Error
$mime_type string
리턴 true | WP_Error

strip_meta() 보호된 메소드

Strips all image meta except color profiles from an image.
부터: 4.5.0
protected strip_meta ( ) : true | WP_Error
리턴 true | WP_Error True if stripping metadata was successful. WP_Error object on error.

supports_mime_type() 공개 정적인 메소드

Checks to see if editor supports the mime-type specified.
부터: 3.5.0
public static supports_mime_type ( string $mime_type ) : boolean
$mime_type string
리턴 boolean

test() 공개 정적인 메소드

We require Imagick 2.2.0 or greater, based on whether the queryFormats() method can be called statically.
부터: 3.5.0
public static test ( array $args = [] ) : boolean
$args array
리턴 boolean

thumbnail_image() 보호된 메소드

This is a WordPress specific implementation of Imagick::thumbnailImage(), which resizes an image to given dimensions and removes any associated profiles.
부터: 4.5.0
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.
리턴 boolean | WP_Error

update_size() 보호된 메소드

Sets or updates current image size.
부터: 3.5.0
protected update_size ( integer $width = null, integer $height = null ) : true | WP_Error
$width integer
$height integer
리턴 true | WP_Error

프로퍼티 상세

$image 보호되어 있는 프로퍼티

Imagick object.
protected Imagick $image
리턴 Imagick