r71926 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r71925‎ | r71926 | r71927 >
Date:05:11, 30 August 2010
Author:tstarling
Status:ok (Comments)
Tags:
Comment:
When calling ImageMagick, put the scene specification inside the shell quotes, so that bash doesn't spend several minutes scanning huge image directories in order to check if a file exists with a zero on the end. Should fix the slowdown observed when PagedTiffHandler was enabled.
Modified paths:
  • /trunk/extensions/PagedTiffHandler/PagedTiffHandler_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/PagedTiffHandler/PagedTiffHandler_body.php
@@ -374,7 +374,7 @@
375375 && $meta['page_data'][$page]['pixels'] > $wgMaxImageArea )
376376 return $this->doThumbError( $params, 'tiff_sourcefile_too_large' );
377377 $cmd = wfEscapeShellArg( $wgImageMagickConvertCommand );
378 - $cmd .= " " . wfEscapeShellArg( $srcPath ) . "[" . ( $page - 1 ) . "]";
 378+ $cmd .= " " . wfEscapeShellArg( $srcPath . "[" . ( $page - 1 ) . "]" );
379379 $cmd .= " -depth 8 -resize {$width} ";
380380 $cmd .= wfEscapeShellArg( $dstPath );
381381 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r71927MFT r71926: fix PagedTiffHandler readdir() slowdown.tstarling05:14, 30 August 2010
r71979MFT r71926: add support for 'min'.siebrand21:07, 30 August 2010

Comments

#Comment by Duesentrieb (talk | contribs)   12:18, 30 August 2010

wow, nice catch

Status & tagging log