(bug 19195) Make user IDs more readily available with the API
[lhc/web/wiklou.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
19 /**
20 * @param $image File
21 * @param $params
22 * @return bool
23 */
24 function normaliseParams( $image, &$params ) {
25 return ImageHandler::normaliseParams( $image, $params );
26 }
27
28 /**
29 * @param $image File
30 * @param $dstPath
31 * @param $dstUrl
32 * @param $params
33 * @param int $flags
34 * @return ThumbnailImage|TransformParameterError
35 */
36 function doTransform( $image, $dstPath, $dstUrl, $params, $flags = 0 ) {
37 if ( !$this->normaliseParams( $image, $params ) ) {
38 return new TransformParameterError( $params );
39 }
40 return new ThumbnailImage( $image, $image->getURL(), $params['width'],
41 $params['height'], $image->getLocalRefPath() );
42 }
43 }