MLA Image Editor Class for Image Manipulation through Imagick PHP Module

since 2.10
package Media Library Assistant
uses \global\WP_Image_Editor_Imagick

 Methods

Loads image from $this->file into new Imagick Object.

load() : boolean | \WP_Error

Sets image resolution and frame from $imagick_args before loading the file.

since 2.10
access protected

Returns

boolean\WP_ErrorTrue if loaded; WP_Error on failure.

Prepare the image for output, scaling and flattening as required

mla_prepare_image(integer $width, integer $height, boolean $best_fit, string $type, integer $quality) : void

since 2.10
access public

Parameters

$width

integer

zero or new width

$height

integer

zero or new height

$best_fit

boolean

proportional fit (true) or exact fit (false)

$type

string

output MIME type

$quality

integer

compression quality; 1 - 100

Set the iterator position

mla_setIteratorIndex(integer $index) : boolean

since 2.10
access public

Parameters

$index

integer

frame/page number

Returns

booleansuccess/failure

Streams current image to browser.

stream(string $mime_type) : boolean | \WP_Error

since 2.10
access public

Parameters

$mime_type

string

Returns

boolean\WP_Error

Direct Ghostscript file conversion

_ghostscript_convert(string $file, string $frame, string $resolution, string $output_type) : boolean

since 2.10

Parameters

$file

string

Input file, e.g., a PDF document

$frame

string

Page/frame within the file, zero-based

$resolution

string

Output file DPI. Default 72.

$output_type

string

Output MIME type; 'image/jpeg' or 'image/png'.

Returns

booleantrue if conversion succeeds else false