dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Followup I888c616e: Keep IRC line format unchanged."
[lhc/web/wiklou.git]
/
includes
/
media
/
DjVuImage.php
diff --git
a/includes/media/DjVuImage.php
b/includes/media/DjVuImage.php
index
bdedbd1
..
cad9c1b
100644
(file)
--- a/
includes/media/DjVuImage.php
+++ b/
includes/media/DjVuImage.php
@@
-34,10
+34,20
@@
* @ingroup Media
*/
class DjVuImage {
* @ingroup Media
*/
class DjVuImage {
+ /**
+ * Constructor
+ *
+ * @param string $filename The DjVu file name.
+ */
function __construct( $filename ) {
$this->mFilename = $filename;
}
function __construct( $filename ) {
$this->mFilename = $filename;
}
+ /**
+ * @const DJVUTXT_MEMORY_LIMIT Memory limit for the DjVu description software
+ */
+ const DJVUTXT_MEMORY_LIMIT = 300000;
+
/**
* Check if the given file is indeed a valid DjVu image file
* @return bool
/**
* Check if the given file is indeed a valid DjVu image file
* @return bool
@@
-252,7
+262,7
@@
class DjVuImage {
$cmd = wfEscapeShellArg( $wgDjvuTxt ) . ' --detail=page ' . wfEscapeShellArg( $this->mFilename ) ;
wfDebug( __METHOD__.": $cmd\n" );
$retval = '';
$cmd = wfEscapeShellArg( $wgDjvuTxt ) . ' --detail=page ' . wfEscapeShellArg( $this->mFilename ) ;
wfDebug( __METHOD__.": $cmd\n" );
$retval = '';
- $txt = wfShellExec( $cmd, $retval, array(), array( 'memory' =>
300000
) );
+ $txt = wfShellExec( $cmd, $retval, array(), array( 'memory' =>
self::DJVUTXT_MEMORY_LIMIT
) );
wfProfileOut( 'djvutxt' );
if( $retval == 0) {
# Strip some control characters
wfProfileOut( 'djvutxt' );
if( $retval == 0) {
# Strip some control characters