mla_handle_thumbnail_sideload()
mla_process_stream_image()
_get_temp_file()
_ghostscript_convert()
_mla_debug_add()
_mla_die()
_mla_error_return()
_prepare_image()
$mla_debug
$image
Class MLA (Media Library Assistant) Image Processor provides PDF thumbnails for the [mla_gallery] mla_viewer and Media/Assistant thumbnail generator.
package | Media Library Assistant |
---|---|
since | 2.10 |
mla_handle_thumbnail_sideload(string $input_file, array $args) : array
Replaces download_url() in the Codex "Function Reference/wp handle sideload" example.
since | 2.13 |
---|
string
Path and name of the source file relative to upload directory
array
Generation parameters
array
file attributes ( 'file', 'url', 'type' ) on success, ( 'error' ) on failuremla_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 |
---|
_get_temp_file(string $extension) : string
since | 2.10 |
---|
string
File extension for the temporary file
string
Writable path and file name._ghostscript_convert(string $file, string $frame, string $resolution, string $output_type, string $explicit_path) : boolean
since | 2.10 |
---|---|
uses | \global\self::$image |
string
Input file, e.g., a PDF document
string
Page/frame within the file, zero-based
string
Output file DPI. Default 72.
string
Output MIME type; 'image/jpeg' or 'image/png'.
string
Optional. Non-standard location to override default search, e.g., 'C:\Program Files (x86)\gs\gs9.15\bin\gswin32c.exe'
boolean
true if conversion succeeds else false_mla_debug_add(string $message)
since | 2.12 |
---|
string
Error message.
_mla_die(string $message, string $title, integer $response) : void
since | 2.10 |
---|
string
Error message.
string
Optional. Error title. Default empty.
integer
Optional. HTML response code. Default 500.
_mla_error_return(string $message, string $line) : \array(
since | 2.10 |
---|
string
Error message.
string
Optional. Line number in the caller.
\array(
'error' => message )_prepare_image(integer $width, integer $height, boolean $best_fit, string $type, integer $quality) : void
since | 2.10 |
---|---|
uses | \global\self::$image |
integer
zero or new width
integer
zero or new height
boolean
proportional fit (true) or exact fit (false)
string
output MIME type
integer
compression quality; 1 - 100
$mla_debug : boolean
since | 2.12 |
---|
$image : \Imagick
since | 2.10 |
---|