Public Member Functions | |
isEnabled () | |
False if the handler is disabled for all files. | |
mustRender ($file) | |
True if handled types cannot be displayed directly in a browser but can be rendered. | |
isMultiPage ($file) | |
True if the type has multi-page capabilities. | |
getParamMap () | |
Get an associative array mapping magic word IDs to parameter names. | |
validateParam ($name, $value) | |
makeParamString ($params) | |
Merge a parameter array into a string appropriate for inclusion in filenames. | |
parseParamString ($str) | |
Parse a param string made with makeParamString back into an array. | |
getScriptParams ($params) | |
doTransform ($image, $dstPath, $dstUrl, $params, $flags=0) | |
Get a MediaTransformOutput object representing the transformed output. | |
getDjVuImage ($image, $path) | |
Cache an instance of DjVuImage in an Image object, return that instance. | |
getMetaTree ($image, $gettext=false) | |
Cache a document tree for the DjVu XML metadata. | |
getImageSize ($image, $path) | |
Get an image size array like that returned by getimagesize(), or false if it can't be determined. | |
getThumbType ($ext, $mime) | |
Get the thumbnail extension and MIME type for a given source MIME type. | |
getMetadata ($image, $path) | |
Get handler-specific metadata which will be saved in the img_metadata field. | |
getMetadataType ($image) | |
Get a string describing the type of metadata, for display purposes. | |
isMetadataValid ($image, $metadata) | |
Check if the metadata string is valid for this handler. | |
pageCount ($image) | |
Page count for a multi-page document, false if unsupported or unknown. | |
getPageDimensions ($image, $page) | |
Get an associative array of page dimensions Currently "width" and "height" are understood, but this might be expanded in the future. | |
getPageText ($image, $page) | |
Generic getter for text layer. |
Definition at line 10 of file DjVu.php.
DjVuHandler::doTransform | ( | $ | image, | |
$ | dstPath, | |||
$ | dstUrl, | |||
$ | params, | |||
$ | flags = 0 | |||
) |
Get a MediaTransformOutput object representing the transformed output.
Does the transform unless $flags contains self::TRANSFORM_LATER.
$image | File: the image object | |
$dstPath | String: filesystem destination path | |
$dstUrl | String: destination URL to use in output HTML | |
$params | Array: arbitrary set of parameters validated by $this->validateParam() | |
$flags | Integer: a bitfield, may contain self::TRANSFORM_LATER |
Reimplemented from MediaHandler.
Definition at line 67 of file DjVu.php.
References $page, $wgDjvuPostProcessor, $wgDjvuRenderer, ImageHandler::normaliseParams(), pageCount(), MediaHandler::removeBadFile(), wfDebug(), wfDebugLog(), wfEscapeShellArg(), wfHostname(), wfMkdirParents(), wfMsg(), wfProfileIn(), wfProfileOut(), and wfShellExec().
DjVuHandler::getDjVuImage | ( | $ | image, | |
$ | path | |||
) |
Cache an instance of DjVuImage in an Image object, return that instance.
Definition at line 124 of file DjVu.php.
References $path.
Referenced by getImageSize(), and getMetadata().
DjVuHandler::getImageSize | ( | $ | image, | |
$ | path | |||
) |
Get an image size array like that returned by getimagesize(), or false if it can't be determined.
$image | File: the image object, or false if there isn't one | |
$fileName | String: the filename |
Reimplemented from ImageHandler.
Definition at line 180 of file DjVu.php.
References $path, and getDjVuImage().
DjVuHandler::getMetadata | ( | $ | image, | |
$ | path | |||
) |
Get handler-specific metadata which will be saved in the img_metadata field.
$image | File: the image object, or false if there isn't one | |
$path | String: the filename |
Reimplemented from MediaHandler.
Definition at line 194 of file DjVu.php.
References $path, getDjVuImage(), and wfDebug().
DjVuHandler::getMetadataType | ( | $ | image | ) |
Get a string describing the type of metadata, for display purposes.
Reimplemented from MediaHandler.
DjVuHandler::getMetaTree | ( | $ | image, | |
$ | gettext = false | |||
) |
Cache a document tree for the DjVu XML metadata.
Definition at line 138 of file DjVu.php.
References isMetadataValid(), wfDebug(), wfProfileIn(), wfProfileOut(), wfRestoreWarnings(), and wfSuppressWarnings().
Referenced by getPageDimensions(), getPageText(), and pageCount().
DjVuHandler::getPageDimensions | ( | $ | image, | |
$ | page | |||
) |
Get an associative array of page dimensions Currently "width" and "height" are understood, but this might be expanded in the future.
Returns false if unknown or if the document is not multi-page.
Reimplemented from MediaHandler.
Definition at line 215 of file DjVu.php.
References $page, and getMetaTree().
DjVuHandler::getPageText | ( | $ | image, | |
$ | page | |||
) |
Generic getter for text layer.
Currently overloaded by PDF and DjVu handlers
Reimplemented from MediaHandler.
Definition at line 232 of file DjVu.php.
References $page, and getMetaTree().
DjVuHandler::getParamMap | ( | ) |
Get an associative array mapping magic word IDs to parameter names.
Will be used by the parser to identify parameters.
Reimplemented from ImageHandler.
DjVuHandler::getScriptParams | ( | $ | params | ) |
DjVuHandler::getThumbType | ( | $ | ext, | |
$ | mime | |||
) |
Get the thumbnail extension and MIME type for a given source MIME type.
Reimplemented from MediaHandler.
Definition at line 184 of file DjVu.php.
References $wgDjvuOutputExtension, and MimeMagic::singleton().
DjVuHandler::isEnabled | ( | ) |
False if the handler is disabled for all files.
Reimplemented from MediaHandler.
Definition at line 11 of file DjVu.php.
References $wgDjvuDump, $wgDjvuRenderer, $wgDjvuToXML, and wfDebug().
DjVuHandler::isMetadataValid | ( | $ | image, | |
$ | metadata | |||
) |
Check if the metadata string is valid for this handler.
If it returns false, Image will reload the metadata from the file and update the database
Reimplemented from MediaHandler.
Definition at line 203 of file DjVu.php.
Referenced by getMetaTree().
DjVuHandler::isMultiPage | ( | $ | file | ) |
DjVuHandler::makeParamString | ( | $ | params | ) |
Merge a parameter array into a string appropriate for inclusion in filenames.
Reimplemented from ImageHandler.
Definition at line 43 of file DjVu.php.
References $page.
DjVuHandler::mustRender | ( | $ | file | ) |
True if handled types cannot be displayed directly in a browser but can be rendered.
Reimplemented from MediaHandler.
DjVuHandler::pageCount | ( | $ | file | ) |
Page count for a multi-page document, false if unsupported or unknown.
Reimplemented from MediaHandler.
Definition at line 207 of file DjVu.php.
References getMetaTree().
Referenced by doTransform().
DjVuHandler::parseParamString | ( | $ | str | ) |
DjVuHandler::validateParam | ( | $ | name, | |
$ | value | |||
) |