Public Member Functions | |
isEnabled () | |
False if the handler is disabled for all files. | |
mustRender () | |
isMultiPage () | |
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) | |
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. |
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 | $image The image object | |
string | $dstPath Filesystem destination path | |
string | $dstUrl Destination URL to use in output HTML | |
array | $params Arbitrary set of parameters validated by $this->validateParam() | |
integer | $flags A bitfield, may contain self::TRANSFORM_LATER |
Reimplemented from MediaHandler.
Definition at line 67 of file DjVu.php.
References $cmd, $flags, $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 | $image The image object, or false if there isn't one | |
string | $fileName The filename |
Reimplemented from ImageHandler.
Definition at line 163 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 | $image The image object, or false if there isn't one | |
string | $fileName The filename |
Reimplemented from MediaHandler.
Definition at line 177 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 | ) |
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(), 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 198 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 167 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 186 of file DjVu.php.
Referenced by getMetaTree().
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::pageCount | ( | $ | file | ) |
Page count for a multi-page document, false if unsupported or unknown.
Reimplemented from MediaHandler.
Definition at line 190 of file DjVu.php.
References getMetaTree().
Referenced by doTransform().
DjVuHandler::parseParamString | ( | $ | str | ) |
DjVuHandler::validateParam | ( | $ | name, | |
$ | value | |||
) |