summaryrefslogtreecommitdiff
path: root/includes/media/DjVu.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/media/DjVu.php')
-rw-r--r--includes/media/DjVu.php21
1 files changed, 10 insertions, 11 deletions
diff --git a/includes/media/DjVu.php b/includes/media/DjVu.php
index 0a39a2cf..b9e89d9d 100644
--- a/includes/media/DjVu.php
+++ b/includes/media/DjVu.php
@@ -185,7 +185,7 @@ class DjVuHandler extends ImageHandler {
}
$cmd .= ' > ' . wfEscapeShellArg( $dstPath ) . ') 2>&1';
wfProfileIn( 'ddjvu' );
- wfDebug( __METHOD__.": $cmd\n" );
+ wfDebug( __METHOD__ . ": $cmd\n" );
$retval = '';
$err = wfShellExec( $cmd, $retval );
wfProfileOut( 'ddjvu' );
@@ -246,24 +246,23 @@ class DjVuHandler extends ImageHandler {
$image->dejaMetaTree = false;
$image->djvuTextTree = false;
$tree = new SimpleXMLElement( $metadata );
- if( $tree->getName() == 'mw-djvu' ) {
- foreach( $tree->children() as $b ) {
- if( $b->getName() == 'DjVuTxt' ) {
+ if ( $tree->getName() == 'mw-djvu' ) {
+ foreach ( $tree->children() as $b ) {
+ if ( $b->getName() == 'DjVuTxt' ) {
$image->djvuTextTree = $b;
- }
- elseif ( $b->getName() == 'DjVuXML' ) {
+ } elseif ( $b->getName() == 'DjVuXML' ) {
$image->dejaMetaTree = $b;
}
}
} else {
$image->dejaMetaTree = $tree;
}
- } catch( Exception $e ) {
+ } catch ( Exception $e ) {
wfDebug( "Bogus multipage XML metadata on '{$image->getName()}'\n" );
}
wfRestoreWarnings();
wfProfileOut( __METHOD__ );
- if( $gettext ) {
+ if ( $gettext ) {
return $image->djvuTextTree;
} else {
return $image->dejaMetaTree;
@@ -294,7 +293,7 @@ class DjVuHandler extends ImageHandler {
}
function isMetadataValid( $image, $metadata ) {
- return !empty( $metadata ) && $metadata != serialize(array());
+ return !empty( $metadata ) && $metadata != serialize( array() );
}
function pageCount( $image ) {
@@ -311,7 +310,7 @@ class DjVuHandler extends ImageHandler {
return false;
}
- $o = $tree->BODY[0]->OBJECT[$page-1];
+ $o = $tree->BODY[0]->OBJECT[$page - 1];
if ( $o ) {
return array(
'width' => intval( $o['width'] ),
@@ -328,7 +327,7 @@ class DjVuHandler extends ImageHandler {
return false;
}
- $o = $tree->BODY[0]->PAGE[$page-1];
+ $o = $tree->BODY[0]->PAGE[$page - 1];
if ( $o ) {
$txt = $o['value'];
return $txt;