r67717 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r67716‎ | r67717 | r67718 >
Date:13:47, 9 June 2010
Author:daniel
Status:deferred
Tags:
Comment:
support for TRANSFORM_LATER
Modified paths:
  • /trunk/extensions/PagedTiffHandler/PagedTiffHandler_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/PagedTiffHandler/PagedTiffHandler_body.php
@@ -225,10 +225,9 @@
226226 }
227227
228228 /**
229 - * doTransform was changed for multipage and lossy support.
230 - * self::TRANSFORM_LATER is ignored. Instead, the function checks whether a
231 - * thumbnail with the requested file type and resolution exists. It will be
232 - * created if necessary.
 229+ * Checks whether a thumbnail with the requested file type and resolution exists,
 230+ * creates it if necessary, unless self::TRANSFORM_LATER is set in $flags.
 231+ * Supports extra parameters for multipage files and thumbnail type (lossless vs. lossy)
233232 */
234233 function doTransform( $image, $dstPath, $dstUrl, $params, $flags = 0 ) {
235234 global $wgImageMagickConvertCommand, $wgTiffMaxEmbedFileResolution, $wgTiffUseVips, $wgTiffVipsCommand;
@@ -255,6 +254,10 @@
256255 $dstPath .= $extension;
257256 $dstUrl .= $extension;
258257
 258+ if ( $flags & self::TRANSFORM_LATER ) { //pretend the thumbnail exists, let it be created by a 404-handler
 259+ return new ThumbnailImage( $image, $dstUrl, $width, $height, $dstPath, $page );
 260+ }
 261+
259262 $meta = unserialize( $metadata );
260263
261264 if ( !$this->extCheck( $meta, $error, $dstPath ) ) {

Status & tagging log