MediaWiki  REL1_22
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 29 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 131 of file DjVu.php.

References $flags, $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.

Returns:
DjVuImage

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.

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

Reimplemented from ImageHandler.

Definition at line 275 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.

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

Reimplemented from MediaHandler.

Definition at line 289 of file DjVu.php.

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

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

Returns:
string

Reimplemented from MediaHandler.

Definition at line 294 of file DjVu.php.

DjVuHandler::getMetaTree ( image,
gettext = false 
)

Cache a document tree for the DjVu XML metadata.

Parameters:
$imageFile
$gettextBoolean: DOCUMENT (Default: false)
Returns:
bool

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.

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.

Note:
For non-paged media, use getImageSize.
Parameters:
$imageFile
$pageWhat page to get dimensions of
Returns:
array|bool

Reimplemented from MediaHandler.

Definition at line 310 of file DjVu.php.

References array(), and getMetaTree().

DjVuHandler::getPageText ( image,
page 
)

Generic getter for text layer.

Currently overloaded by PDF and DjVu handlers

Returns:
bool

Reimplemented from MediaHandler.

Definition at line 327 of file DjVu.php.

References getMetaTree().

Returns:
array

Reimplemented from ImageHandler.

Definition at line 63 of file DjVu.php.

References array().

Parameters:
$params
Returns:
array

Reimplemented from ImageHandler.

Definition at line 116 of file DjVu.php.

References $params, and array().

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

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

Parameters:
String$extExtension of original file
String$mimeMime type of original file
Array$paramsHandler specific rendering parameters
Returns:
array thumbnail extension and MIME type

Reimplemented from MediaHandler.

Definition at line 279 of file DjVu.php.

References $mime, array(), global, and MimeMagic\singleton().

Returns:
bool

Reimplemented from MediaHandler.

Definition at line 34 of file DjVu.php.

References global, 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).

Returns:
bool

Reimplemented from MediaHandler.

Definition at line 298 of file DjVu.php.

References array(), and empty.

Referenced by getMetaTree().

Parameters:
$file
Returns:
bool

Reimplemented from MediaHandler.

Definition at line 56 of file DjVu.php.

Parameters:
$params
Returns:
bool|string

Reimplemented from ImageHandler.

Definition at line 91 of file DjVu.php.

References $params.

Parameters:
$file
Returns:
bool

Reimplemented from MediaHandler.

Definition at line 48 of file DjVu.php.

Page count for a multi-page document, false if unsupported or unknown.

Returns:
bool

Reimplemented from MediaHandler.

Definition at line 302 of file DjVu.php.

References getMetaTree().

Referenced by doTransform().

Parameters:
$str
Returns:
array|bool

Reimplemented from ImageHandler.

Definition at line 103 of file DjVu.php.

References array().

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

Reimplemented from ImageHandler.

Definition at line 75 of file DjVu.php.

References $name, $value, and array().


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