MediaWiki  1.28.1
DjVuImage Class Reference

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

Public Member Functions

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

Public Attributes

const DJVUTXT_MEMORY_LIMIT = 300000
 DJVUTXT_MEMORY_LIMIT Memory limit for the DjVu description software More...
 

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

DjVuImage::__construct (   $filename)

Constructor.

Parameters
string$filenameThe DjVu file name.

Definition at line 47 of file DjVuImage.php.

Member Function Documentation

DjVuImage::convertDumpToXML (   $dump)

Hack to temporarily work around djvutoxml bug.

Parameters
string$dump
Returns
string

Definition at line 310 of file DjVuImage.php.

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

Referenced by retrieveMetaData().

DjVuImage::dump ( )

For debugging; dump the IFF chunk structure.

Definition at line 84 of file DjVuImage.php.

References $header, and dumpForm().

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

Definition at line 95 of file DjVuImage.php.

Referenced by dump().

DjVuImage::getImageSize ( )

Return data in the style of getimagesize()

Returns
array|bool Array or false on failure

Definition at line 65 of file DjVuImage.php.

References getInfo().

DjVuImage::getInfo ( )

Definition at line 121 of file DjVuImage.php.

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

Referenced by getImageSize(), and isValid().

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

Definition at line 177 of file DjVuImage.php.

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

Referenced by getInfo().

DjVuImage::getPageInfo (   $file)
private

Definition at line 206 of file DjVuImage.php.

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

Referenced by getInfo(), and getMultiPageInfo().

DjVuImage::isValid ( )

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

Returns
bool

Definition at line 55 of file DjVuImage.php.

References getInfo().

Referenced by retrieveMetaData().

DjVuImage::pageTextCallback (   $matches)

Definition at line 298 of file DjVuImage.php.

References $matches.

DjVuImage::parseFormDjvu (   $line,
$xml 
)

Definition at line 371 of file DjVuImage.php.

References $line, Xml\element(), and Xml\tags().

Referenced by convertDumpToXML().

DjVuImage::readChunk (   $file)
private

Definition at line 157 of file DjVuImage.php.

References $header.

Referenced by getMultiPageInfo(), and getPageInfo().

DjVuImage::retrieveMetaData ( )

Return an XML string describing the DjVu image.

Returns
string|bool

Definition at line 248 of file DjVuImage.php.

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

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

Definition at line 168 of file DjVuImage.php.

Referenced by getMultiPageInfo().

Member Data Documentation

const DjVuImage::DJVUTXT_MEMORY_LIMIT = 300000

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: