DjVuHandler Class Reference

Inherits ImageHandler.

List of all members.

Public Member Functions

 isEnabled ()
 False if the handler is disabled for all files.
 mustRender ()
 isMultiPage ()
 getParamMap ()
 Get an associative array mapping magic word IDs to parameter names.
 validateParam ($name, $value)
 makeParamString ($params)
 Merge a parameter array into a string appropriate for inclusion in filenames.
 parseParamString ($str)
 Parse a param string made with makeParamString back into an array.
 getScriptParams ($params)
 doTransform ($image, $dstPath, $dstUrl, $params, $flags=0)
 Get a MediaTransformOutput object representing the transformed output.
 getDjVuImage ($image, $path)
 Cache an instance of DjVuImage in an Image object, return that instance.
 getMetaTree ($image)
 Cache a document tree for the DjVu XML metadata.
 getImageSize ($image, $path)
 Get an image size array like that returned by getimagesize(), or false if it can't be determined.
 getThumbType ($ext, $mime)
 Get the thumbnail extension and MIME type for a given source MIME type.
 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.
 isMetadataValid ($image, $metadata)
 Check if the metadata string is valid for this handler.
 pageCount ($image)
 Page count for a multi-page document, false if unsupported or unknown.
 getPageDimensions ($image, $page)
 Get an associative array of page dimensions Currently "width" and "height" are understood, but this might be expanded in the future.


Detailed Description

Definition at line 10 of file DjVu.php.


Member Function Documentation

DjVuHandler::doTransform ( image,
dstPath,
dstUrl,
params,
flags = 0 
)

Get a MediaTransformOutput object representing the transformed output.

Does the transform unless $flags contains self::TRANSFORM_LATER.

Parameters:
Image $image The image object
string $dstPath Filesystem destination path
string $dstUrl Destination URL to use in output HTML
array $params Arbitrary set of parameters validated by $this->validateParam()
integer $flags A bitfield, may contain self::TRANSFORM_LATER

Reimplemented from MediaHandler.

Definition at line 67 of file DjVu.php.

References $cmd, $flags, $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 124 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:
Image $image The image object, or false if there isn't one
string $fileName The filename
Returns:
array

Reimplemented from ImageHandler.

Definition at line 163 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:
Image $image The image object, or false if there isn't one
string $fileName The filename
Returns:
string

Reimplemented from MediaHandler.

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

Definition at line 182 of file DjVu.php.

DjVuHandler::getMetaTree ( image  ) 

Cache a document tree for the DjVu XML metadata.

Definition at line 138 of file DjVu.php.

References isMetadataValid(), wfDebug(), wfProfileIn(), wfProfileOut(), wfRestoreWarnings(), and wfSuppressWarnings().

Referenced by getPageDimensions(), 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.

Reimplemented from MediaHandler.

Definition at line 198 of file DjVu.php.

References $page, and getMetaTree().

DjVuHandler::getParamMap (  ) 

Get an associative array mapping magic word IDs to parameter names.

Will be used by the parser to identify parameters.

Reimplemented from ImageHandler.

Definition at line 24 of file DjVu.php.

DjVuHandler::getScriptParams ( params  ) 

Reimplemented from ImageHandler.

Definition at line 60 of file DjVu.php.

DjVuHandler::getThumbType ( ext,
mime 
)

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 167 of file DjVu.php.

References $wgDjvuOutputExtension, and MimeMagic::singleton().

DjVuHandler::isEnabled (  ) 

False if the handler is disabled for all files.

Reimplemented from MediaHandler.

Definition at line 11 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 false, Image will reload the metadata from the file and update the database

Reimplemented from MediaHandler.

Definition at line 186 of file DjVu.php.

Referenced by getMetaTree().

DjVuHandler::isMultiPage (  ) 

Definition at line 22 of file DjVu.php.

DjVuHandler::makeParamString ( params  ) 

Merge a parameter array into a string appropriate for inclusion in filenames.

Reimplemented from ImageHandler.

Definition at line 43 of file DjVu.php.

References $page.

DjVuHandler::mustRender (  ) 

Definition at line 21 of file DjVu.php.

DjVuHandler::pageCount ( file  ) 

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

Reimplemented from MediaHandler.

Definition at line 190 of file DjVu.php.

References getMetaTree().

Referenced by doTransform().

DjVuHandler::parseParamString ( str  ) 

Parse a param string made with makeParamString back into an array.

Reimplemented from ImageHandler.

Definition at line 51 of file DjVu.php.

DjVuHandler::validateParam ( name,
value 
)

Reimplemented from ImageHandler.

Definition at line 31 of file DjVu.php.

References $name.


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

Generated on Sat Sep 5 02:08:36 2009 for MediaWiki by  doxygen 1.5.9