MediaWiki  REL1_19
DjVuHandler Class Reference

Handler for DjVu images. More...

Inheritance diagram for DjVuHandler:
Collaboration diagram for DjVuHandler:

List of all members.

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)

Detailed Description

Handler for DjVu images.

Definition at line 14 of file DjVu.php.


Member Function Documentation

DjVuHandler::doTransform ( image,
dstPath,
dstUrl,
params,
flags = 0 
)
Parameters:
$imageFile
$dstPath
$dstUrl
$params
int$flags
Returns:
MediaTransformError|ThumbnailImage|TransformParameterError

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().

Here is the call graph for this function:

DjVuHandler::getDjVuImage ( image,
path 
)

Cache an instance of DjVuImage in an Image object, return that instance.

Returns:
DjVuImage

Definition at line 182 of file DjVu.php.

References $path.

Referenced by getImageSize(), and getMetadata().

Here is the caller graph for this function:

DjVuHandler::getImageSize ( image,
path 
)

Get an image size array like that returned by getimagesize(), or false if it can't be determined.

Parameters:
$imageFile: the image object, or false if there isn't one
$pathString: the filename
Returns:
Array Follow the format of PHP getimagesize() internal function. See http://www.php.net/getimagesize

Reimplemented from ImageHandler.

Definition at line 240 of file DjVu.php.

References $path, and getDjVuImage().

Here is the call graph for this function:

DjVuHandler::getMetadata ( image,
path 
)

Get handler-specific metadata which will be saved in the img_metadata field.

Parameters:
$imageFile: the image object, or false if there isn't one. Warning, FSFile::getPropsFromPath might pass an (object)array() instead (!)
$pathString: the filename
Returns:
String

Reimplemented from MediaHandler.

Definition at line 254 of file DjVu.php.

References $path, getDjVuImage(), and wfDebug().

Here is the call graph for this function:

Get a string describing the type of metadata, for display purposes.

Returns:
string

Reimplemented from MediaHandler.

Definition at line 259 of file DjVu.php.

DjVuHandler::getMetaTree ( image,
gettext = false 
)

Cache a document tree for the DjVu XML metadata.

Parameters:
$imageFile
$gettextBoolean: 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().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
$imageFile

Reimplemented from MediaHandler.

Definition at line 275 of file DjVu.php.

References $page, and getMetaTree().

Here is the call graph for this function:

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().

Here is the call graph for this function:

Returns:
array

Reimplemented from ImageHandler.

Definition at line 48 of file DjVu.php.

Parameters:
$params
Returns:
array

Reimplemented from ImageHandler.

Definition at line 101 of file DjVu.php.

DjVuHandler::getThumbType ( ext,
mime,
params = null 
)

Get the thumbnail extension and MIME type for a given source MIME type.

Returns:
array thumbnail extension and MIME type

Reimplemented from MediaHandler.

Definition at line 244 of file DjVu.php.

References $mime, $wgDjvuOutputExtension, and MimeMagic\singleton().

Here is the call graph for this function:

Returns:
bool

Reimplemented from MediaHandler.

Definition at line 19 of file DjVu.php.

References $wgDjvuDump, $wgDjvuRenderer, $wgDjvuToXML, and wfDebug().

Here is the call graph for this function:

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().

Here is the caller graph for this function:

Parameters:
$file
Returns:
bool

Reimplemented from MediaHandler.

Definition at line 41 of file DjVu.php.

Parameters:
$params
Returns:
bool|string

Reimplemented from ImageHandler.

Definition at line 76 of file DjVu.php.

References $page.

Parameters:
$file
Returns:
bool

Reimplemented from MediaHandler.

Definition at line 33 of file DjVu.php.

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().

Here is the call graph for this function:

Here is the caller graph for this function:

Parameters:
$str
Returns:
array|bool

Reimplemented from ImageHandler.

Definition at line 88 of file DjVu.php.

DjVuHandler::validateParam ( name,
value 
)
Parameters:
$name
$value
Returns:
bool

Reimplemented from ImageHandler.

Definition at line 60 of file DjVu.php.


The documentation for this class was generated from the following file: