MediaWiki
REL1_24
|
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) | |
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) | |
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) | |
Private Member Functions | |
getUnserializedMetadata (File $file) | |
Get metadata, unserializing it if neccessary. |
DjVuHandler::doTransform | ( | $ | image, |
$ | dstPath, | ||
$ | dstUrl, | ||
$ | params, | ||
$ | flags = 0 |
||
) |
File | $image | |
string | $dstPath | |
string | $dstUrl | |
array | $params | |
int | $flags |
Reimplemented from MediaHandler.
Reimplemented in MockDjVuHandler.
Definition at line 137 of file DjVu.php.
References $flags, $params, $retval, array(), global, MediaHandler\logErrorForExternalProcess(), 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.
File | $image | |
string | $path |
Definition at line 252 of file DjVu.php.
References $path.
Referenced by getImageSize(), and getMetadata().
DjVuHandler::getImageSize | ( | $ | image, |
$ | path | ||
) |
File | $image | |
string | $path |
Reimplemented from ImageHandler.
Definition at line 354 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.
File | $image | 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 369 of file DjVu.php.
References $path, array(), getDjVuImage(), and wfDebug().
DjVuHandler::getMetadataType | ( | $ | image | ) |
Get a string describing the type of metadata, for display purposes.
File | $image |
Reimplemented from MediaHandler.
DjVuHandler::getMetaTree | ( | $ | image, |
$ | gettext = false |
||
) |
Cache a document tree for the DjVu XML metadata.
File | $image | |
bool | $gettext | DOCUMENT (Default: false) |
Definition at line 301 of file DjVu.php.
References $e, as, getUnserializedMetadata(), 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.
It is expected that handlers for paged media (e.g. DjVuHandler) will override this method so that it gives the correct results for each specific page of the file, using the $page argument.
File | $image | |
int | $page | What page to get dimensions of |
Reimplemented from MediaHandler.
Definition at line 398 of file DjVu.php.
References array(), and getMetaTree().
DjVuHandler::getPageText | ( | $ | image, |
$ | page | ||
) |
Reimplemented from MediaHandler.
Definition at line 420 of file DjVu.php.
References getMetaTree().
Reimplemented from ImageHandler.
Definition at line 63 of file DjVu.php.
References array().
DjVuHandler::getScriptParams | ( | $ | params | ) |
array | $params |
Reimplemented from ImageHandler.
DjVuHandler::getThumbType | ( | $ | ext, |
$ | mime, | ||
$ | params = null |
||
) |
Get the thumbnail extension and MIME type for a given source MIME type.
string | $ext | Extension of original file |
string | $mime | MIME type of original file |
array | $params | Handler specific rendering parameters |
Reimplemented from MediaHandler.
Definition at line 358 of file DjVu.php.
References $mime, array(), global, and MimeMagic\singleton().
DjVuHandler::getUnserializedMetadata | ( | File $ | file | ) | [private] |
Get metadata, unserializing it if neccessary.
File | $file | The DjVu file in question |
Definition at line 270 of file DjVu.php.
References File\getMetadata(), wfRestoreWarnings(), and wfSuppressWarnings().
Referenced by getMetaTree().
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, MediaHandler::METADATA_COMPATIBLE if metadata is old but backwards compatible (which may or may not trigger a metadata reload).
File | $image | |
string | $metadata | The metadata in serialized form |
Reimplemented from MediaHandler.
Definition at line 385 of file DjVu.php.
References array(), and empty.
Referenced by getMetaTree().
DjVuHandler::isMultiPage | ( | $ | file | ) |
DjVuHandler::makeParamString | ( | $ | params | ) |
array | $params |
Reimplemented from ImageHandler.
Definition at line 96 of file DjVu.php.
References $params.
DjVuHandler::mustRender | ( | $ | file | ) |
DjVuHandler::pageCount | ( | $ | file | ) |
Page count for a multi-page document, false if unsupported or unknown.
File | $file |
Reimplemented from MediaHandler.
Definition at line 389 of file DjVu.php.
References getMetaTree().
Referenced by MockDjVuHandler\doTransform(), and doTransform().
DjVuHandler::parseParamString | ( | $ | str | ) |
string | $str |
Reimplemented from ImageHandler.
Definition at line 109 of file DjVu.php.
References array().
DjVuHandler::validateParam | ( | $ | name, |
$ | value | ||
) |