MediaWiki
REL1_19
|
Handler for DjVu images. More...
Public Member Functions | |
doTransform ($image, $dstPath, $dstUrl, $params, $flags=0) | |
getDjVuImage ($image, $path) | |
Cache an instance of DjVuImage in an Image object, return that instance. | |
getImageSize ($image, $path) | |
Get an image size array like that returned by getimagesize(), or false if it can't be determined. | |
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. | |
getMetaTree ($image, $gettext=false) | |
Cache a document tree for the DjVu XML metadata. | |
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. | |
getParamMap () | |
getScriptParams ($params) | |
getThumbType ($ext, $mime, $params=null) | |
Get the thumbnail extension and MIME type for a given source MIME type. | |
isEnabled () | |
isMetadataValid ($image, $metadata) | |
Check if the metadata string is valid for this handler. | |
isMultiPage ($file) | |
makeParamString ($params) | |
mustRender ($file) | |
pageCount ($image) | |
Page count for a multi-page document, false if unsupported or unknown. | |
parseParamString ($str) | |
validateParam ($name, $value) |
DjVuHandler::doTransform | ( | $ | image, |
$ | dstPath, | ||
$ | dstUrl, | ||
$ | params, | ||
$ | flags = 0 |
||
) |
$image | File | |
$dstPath | ||
$dstUrl | ||
$params | ||
int | $flags |
Reimplemented from MediaHandler.
Definition at line 116 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 182 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 |
$path | String: the filename |
Reimplemented from ImageHandler.
Definition at line 240 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. Warning, FSFile::getPropsFromPath might pass an (object)array() instead (!) |
$path | String: the filename |
Reimplemented from MediaHandler.
Definition at line 254 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.
$image | File |
$gettext | Boolean: DOCUMENT (Default: false) |
Definition at line 198 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.
$image | File |
Reimplemented from MediaHandler.
Definition at line 275 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 292 of file DjVu.php.
References $page, and getMetaTree().
DjVuHandler::getScriptParams | ( | $ | params | ) |
DjVuHandler::getThumbType | ( | $ | ext, |
$ | mime, | ||
$ | params = null |
||
) |
Get the thumbnail extension and MIME type for a given source MIME type.
Reimplemented from MediaHandler.
Definition at line 244 of file DjVu.php.
References $mime, $wgDjvuOutputExtension, and MimeMagic\singleton().
Reimplemented from MediaHandler.
Definition at line 19 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 MediaHandler::METADATA_BAD (or false), Image will reload the metadata from the file and update the database. MediaHandler::METADATA_GOOD for if the metadata is a-ok, MediaHanlder::METADATA_COMPATIBLE if metadata is old but backwards compatible (which may or may not trigger a metadata reload).
Reimplemented from MediaHandler.
Definition at line 263 of file DjVu.php.
Referenced by getMetaTree().
DjVuHandler::isMultiPage | ( | $ | file | ) |
DjVuHandler::makeParamString | ( | $ | params | ) |
$params |
Reimplemented from ImageHandler.
Definition at line 76 of file DjVu.php.
References $page.
DjVuHandler::mustRender | ( | $ | file | ) |
DjVuHandler::pageCount | ( | $ | file | ) |
Page count for a multi-page document, false if unsupported or unknown.
Reimplemented from MediaHandler.
Definition at line 267 of file DjVu.php.
References getMetaTree().
Referenced by doTransform().
DjVuHandler::parseParamString | ( | $ | str | ) |
DjVuHandler::validateParam | ( | $ | name, |
$ | value | ||
) |