Index: trunk/extensions/PagedTiffHandler/PagedTiffHandler_body.php |
— | — | @@ -225,10 +225,9 @@ |
226 | 226 | } |
227 | 227 | |
228 | 228 | /** |
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) |
233 | 232 | */ |
234 | 233 | function doTransform( $image, $dstPath, $dstUrl, $params, $flags = 0 ) { |
235 | 234 | global $wgImageMagickConvertCommand, $wgTiffMaxEmbedFileResolution, $wgTiffUseVips, $wgTiffVipsCommand; |
— | — | @@ -255,6 +254,10 @@ |
256 | 255 | $dstPath .= $extension; |
257 | 256 | $dstUrl .= $extension; |
258 | 257 | |
| 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 | + |
259 | 262 | $meta = unserialize( $metadata ); |
260 | 263 | |
261 | 264 | if ( !$this->extCheck( $meta, $error, $dstPath ) ) { |