]> scripts.mit.edu Git - autoinstalls/mediawiki.git/blob - includes/media/Bitmap_ClientOnly.php
MediaWiki 1.17.0
[autoinstalls/mediawiki.git] / includes / media / Bitmap_ClientOnly.php
1 <?php
2 /**
3  * Handler for bitmap images that will be resized by clients
4  *
5  * @file
6  * @ingroup Media
7  */
8
9 /**
10  * Handler for bitmap images that will be resized by clients.
11  *
12  * This is not used by default but can be assigned to some image types
13  * using $wgMediaHandlers.
14  *
15  * @ingroup Media
16  */
17 class BitmapHandler_ClientOnly extends BitmapHandler {
18         function normaliseParams( $image, &$params ) {
19                 return ImageHandler::normaliseParams( $image, $params );
20         }
21
22         function doTransform( $image, $dstPath, $dstUrl, $params, $flags = 0 ) {
23                 if ( !$this->normaliseParams( $image, $params ) ) {
24                         return new TransformParameterError( $params );
25                 }
26                 return new ThumbnailImage( $image, $image->getURL(), $params['width'], 
27                         $params['height'], $image->getPath() );
28         }
29 }