Class MLA (Media Library Assistant) Stream Image provides PDF thumbnails for the [mla_gallery] mla_viewer.

package Media Library Assistant
since 2.10

 Methods

Process Imagick image stream request, e.g., for a PDF thumbnail

mla_process_stream_image() : void

Requires mla_stream_file (relative to wp_upload_dir ) in $_REQUEST; optional $_REQUEST parameters are: mla_stream_width, mla_stream_height, mla_stream_frame, mla_stream_resolution, mla_stream_quality, mla_stream_type, mla_stream_fit, mla_ghostscript_path

since 2.10

Generate a unique, writable file in the temporary directory

_get_temp_file(string $extension) : string

since 2.10

Parameters

$extension

string

File extension for the temporary file

Returns

stringWritable path and file name.

Direct Ghostscript file conversion

_ghostscript_convert(string $file, string $frame, string $resolution, string $output_type, string $explicit_path) : 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'.

$explicit_path

string

Non-standard location to override default search, e.g., 'C:\Program Files (x86)\gs\gs9.15\bin\gswin32c.exe'

Returns

booleantrue if conversion succeeds else false

Abort the operation and exit

_mla_die(string $message, string $title, integer $response) : void

since 2.10

Parameters

$message

string

Error message.

$title

string

Optional. Error title. Default empty.

$response

integer

Optional. HTML response code. Default 500.

Prepare the image for output, scaling and flattening as required

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

since 2.10

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

 Properties

 

Imagick object for the image to be streamed

$image : \Imagick

since 2.10