MediaWiki REL1_30
DjVuImage Class Reference

Support for detecting/validating DjVu image files and getting some basic file metadata (resolution etc) More...

Public Member Functions

 __construct ( $filename)
 
 convertDumpToXML ( $dump)
 Hack to temporarily work around djvutoxml bug.
 
 dump ()
 For debugging; dump the IFF chunk structure.
 
 getImageSize ()
 Return data in the style of getimagesize()
 
 getInfo ()
 
 isValid ()
 Check if the given file is indeed a valid DjVu image file.
 
 pageTextCallback ( $matches)
 
 parseFormDjvu ( $line, &$xml)
 
 retrieveMetaData ()
 Return an XML string describing the DjVu image.
 

Public Attributes

const DJVUTXT_MEMORY_LIMIT = 300000
 @const DJVUTXT_MEMORY_LIMIT Memory limit for the DjVu description software
 

Private Member Functions

 dumpForm ( $file, $length, $indent)
 
 getMultiPageInfo ( $file, $formLength)
 
 getPageInfo ( $file)
 
 readChunk ( $file)
 
 skipChunk ( $file, $chunkLength)
 

Detailed Description

Support for detecting/validating DjVu image files and getting some basic file metadata (resolution etc)

File format docs are available in source package for DjVuLibre: http://djvulibre.djvuzone.org/

Definition at line 36 of file DjVuImage.php.

Constructor & Destructor Documentation

◆ __construct()

DjVuImage::__construct ( $filename)
Parameters
string$filenameThe DjVu file name.

Definition at line 45 of file DjVuImage.php.

Member Function Documentation

◆ convertDumpToXML()

DjVuImage::convertDumpToXML ( $dump)

Hack to temporarily work around djvutoxml bug.

Parameters
string$dump
Returns
string

Definition at line 308 of file DjVuImage.php.

References $line, parseFormDjvu(), version, and wfDebug().

Referenced by retrieveMetaData().

◆ dump()

DjVuImage::dump ( )

For debugging; dump the IFF chunk structure.

Definition at line 82 of file DjVuImage.php.

References $header, and dumpForm().

◆ dumpForm()

DjVuImage::dumpForm ( $file,
$length,
$indent )
private

Definition at line 93 of file DjVuImage.php.

References dumpForm().

Referenced by dump(), and dumpForm().

◆ getImageSize()

DjVuImage::getImageSize ( )

Return data in the style of getimagesize()

Returns
array|bool Array or false on failure

Definition at line 63 of file DjVuImage.php.

References getInfo().

◆ getInfo()

DjVuImage::getInfo ( )

Definition at line 119 of file DjVuImage.php.

References $header, getMultiPageInfo(), getPageInfo(), and wfDebug().

Referenced by getImageSize(), and isValid().

◆ getMultiPageInfo()

DjVuImage::getMultiPageInfo ( $file,
$formLength )
private

Definition at line 175 of file DjVuImage.php.

References getPageInfo(), list, readChunk(), skipChunk(), and wfDebug().

Referenced by getInfo().

◆ getPageInfo()

DjVuImage::getPageInfo ( $file)
private

Definition at line 204 of file DjVuImage.php.

References list, readChunk(), and wfDebug().

Referenced by getInfo(), and getMultiPageInfo().

◆ isValid()

DjVuImage::isValid ( )

Check if the given file is indeed a valid DjVu image file.

Returns
bool

Definition at line 53 of file DjVuImage.php.

References getInfo().

Referenced by retrieveMetaData().

◆ pageTextCallback()

DjVuImage::pageTextCallback ( $matches)

Definition at line 296 of file DjVuImage.php.

References $matches.

◆ parseFormDjvu()

DjVuImage::parseFormDjvu ( $line,
& $xml )

Definition at line 369 of file DjVuImage.php.

References $line.

Referenced by convertDumpToXML().

◆ readChunk()

DjVuImage::readChunk ( $file)
private

Definition at line 155 of file DjVuImage.php.

References $header.

Referenced by getMultiPageInfo(), and getPageInfo().

◆ retrieveMetaData()

DjVuImage::retrieveMetaData ( )

Return an XML string describing the DjVu image.

Returns
string|bool

Definition at line 246 of file DjVuImage.php.

References $retval, $wgDjvuDump, $wgDjvuToXML, $wgDjvuTxt, convertDumpToXML(), isValid(), wfDebug(), wfEscapeShellArg(), and wfShellExec().

◆ skipChunk()

DjVuImage::skipChunk ( $file,
$chunkLength )
private

Definition at line 166 of file DjVuImage.php.

Referenced by getMultiPageInfo().

Member Data Documentation

◆ DJVUTXT_MEMORY_LIMIT

const DjVuImage::DJVUTXT_MEMORY_LIMIT = 300000

@const DJVUTXT_MEMORY_LIMIT Memory limit for the DjVu description software

Definition at line 40 of file DjVuImage.php.


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