DjVuImage Class Reference

Copyright (C) 2006 Brion Vibber <brion@pobox.com> http://www.mediawiki.org/. More...

List of all members.

Public Member Functions

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

Private Member Functions

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


Detailed Description

Copyright (C) 2006 Brion Vibber <brion@pobox.com> http://www.mediawiki.org/.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. http://www.gnu.org/copyleft/gpl.html 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 34 of file DjVuImage.php.


Constructor & Destructor Documentation

DjVuImage::__construct ( filename  ) 

Definition at line 35 of file DjVuImage.php.

References $filename.


Member Function Documentation

DjVuImage::convertDumpToXML ( dump  ) 

Hack to temporarily work around djvutoxml bug.

Definition at line 251 of file DjVuImage.php.

References parseFormDjvu(), wfDebug(), and xml.

Referenced by retrieveMetaData().

DjVuImage::dump (  ) 

For debugging; dump the IFF chunk structure.

Definition at line 71 of file DjVuImage.php.

References $file, and dumpForm().

DjVuImage::dumpForm ( file,
length,
indent 
) [private]

Definition at line 81 of file DjVuImage.php.

References $file, and $start.

Referenced by dump().

DjVuImage::getImageSize (  ) 

Return data in the style of getimagesize().

Returns:
array or false on failure

Definition at line 53 of file DjVuImage.php.

References getInfo().

DjVuImage::getInfo (  ) 

DjVuImage::getMultiPageInfo ( file,
formLength 
) [private]

Definition at line 160 of file DjVuImage.php.

References $file, $start, getPageInfo(), readChunk(), skipChunk(), and wfDebug().

Referenced by getInfo().

DjVuImage::getPageInfo ( file,
formLength 
) [private]

Definition at line 187 of file DjVuImage.php.

References $file, 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 43 of file DjVuImage.php.

References getInfo().

DjVuImage::parseFormDjvu ( line,
&$  xml 
)

Definition at line 310 of file DjVuImage.php.

References Xml::element(), and Xml::tags().

Referenced by convertDumpToXML().

DjVuImage::readChunk ( file  )  [private]

Definition at line 140 of file DjVuImage.php.

References $file.

Referenced by getMultiPageInfo(), and getPageInfo().

DjVuImage::retrieveMetaData (  ) 

Return an XML string describing the DjVu image.

Returns:
string

Definition at line 226 of file DjVuImage.php.

References $cmd, $wgDjvuDump, $wgDjvuToXML, convertDumpToXML(), wfEscapeShellArg(), wfProfileIn(), wfProfileOut(), and wfShellExec().

DjVuImage::skipChunk ( file,
chunkLength 
) [private]

Definition at line 151 of file DjVuImage.php.

References $file.

Referenced by getMultiPageInfo().


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