Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 3 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| Jpeg2000Handler | |
0.00% |
0 / 2 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
| mustRender | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getThumbType | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | /** |
| 3 | * Handler for JPEG2000 images. |
| 4 | * |
| 5 | * @license GPL-2.0-or-later |
| 6 | * @file |
| 7 | * @ingroup Media |
| 8 | */ |
| 9 | |
| 10 | namespace MediaWiki\Media; |
| 11 | |
| 12 | use MediaWiki\FileRepo\File\File; |
| 13 | |
| 14 | /** |
| 15 | * Handler for JPEG2000 images. |
| 16 | * image/jp2 and image/jpx (jpeg2000 part 2) |
| 17 | * |
| 18 | * @ingroup Media |
| 19 | */ |
| 20 | class Jpeg2000Handler extends BitmapHandler { |
| 21 | |
| 22 | /** |
| 23 | * Not all browsers support jpeg2000 |
| 24 | * |
| 25 | * @param File $file |
| 26 | * @return bool |
| 27 | */ |
| 28 | public function mustRender( $file ) { |
| 29 | return true; |
| 30 | } |
| 31 | |
| 32 | /** |
| 33 | * Render files as PNG |
| 34 | * |
| 35 | * @param string $ext |
| 36 | * @param string $mime |
| 37 | * @param array|null $params |
| 38 | * @return array |
| 39 | */ |
| 40 | public function getThumbType( $ext, $mime, $params = null ) { |
| 41 | return [ 'png', 'image/png' ]; |
| 42 | } |
| 43 | |
| 44 | } |
| 45 | |
| 46 | /** @deprecated class alias since 1.46 */ |
| 47 | class_alias( Jpeg2000Handler::class, 'Jpeg2000Handler' ); |