MediaWiki
REL1_21
|
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 131 of file DjVu.php.
References $flags, $page, $params, $retval, array(), global, ImageHandler\normaliseParams(), pageCount(), MediaHandler\removeBadFile(), text, wfDebug(), wfDebugLog(), wfEscapeShellArg(), wfHostname(), wfMessage(), wfMkdirParents(), wfProfileIn(), wfProfileOut(), and wfShellExec().
DjVuHandler::getDjVuImage | ( | $ | image, |
$ | path | ||
) |
Cache an instance of DjVuImage in an Image object, return that instance.
Definition at line 217 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 | |
string | $path | the filename |
Reimplemented from ImageHandler.
Definition at line 276 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 (!) | |
string | $path | the filename |
Reimplemented from MediaHandler.
Definition at line 290 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 234 of file DjVu.php.
References as, 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 |
$page | Unused, left for backcompatibility? |
Reimplemented from MediaHandler.
Definition at line 311 of file DjVu.php.
References $page, array(), and getMetaTree().
DjVuHandler::getPageText | ( | $ | image, |
$ | page | ||
) |
Generic getter for text layer.
Currently overloaded by PDF and DjVu handlers
Reimplemented from MediaHandler.
Definition at line 328 of file DjVu.php.
References $page, and getMetaTree().
Reimplemented from ImageHandler.
Definition at line 63 of file DjVu.php.
References array().
DjVuHandler::getScriptParams | ( | $ | params | ) |
$params |
Reimplemented from ImageHandler.
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 280 of file DjVu.php.
References $mime, array(), global, and MimeMagic\singleton().
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 299 of file DjVu.php.
References array(), and empty.
Referenced by getMetaTree().
DjVuHandler::isMultiPage | ( | $ | file | ) |
DjVuHandler::makeParamString | ( | $ | params | ) |
$params |
Reimplemented from ImageHandler.
DjVuHandler::mustRender | ( | $ | file | ) |
DjVuHandler::pageCount | ( | $ | file | ) |
Page count for a multi-page document, false if unsupported or unknown.
Reimplemented from MediaHandler.
Definition at line 303 of file DjVu.php.
References getMetaTree().
Referenced by doTransform().
DjVuHandler::parseParamString | ( | $ | str | ) |
$str |
Reimplemented from ImageHandler.
Definition at line 103 of file DjVu.php.
References array().
DjVuHandler::validateParam | ( | $ | name, |
$ | value | ||
) |