MediaWiki master
TransformTooBigImageAreaError.php
Go to the documentation of this file.
1<?php
10namespace MediaWiki\Media;
11
20
27 public function __construct( $params, $maxImageArea ) {
28 $msg = wfMessage( 'thumbnail_toobigimagearea' );
29 $msg->params(
30 // messages used: size-pixel, size-kilopixel, size-megapixel, size-gigapixel, size-terapixel,
31 // size-petapixel, size-exapixel, size-zettapixel, size-yottapixel, size-ronnapixel, size-quettapixel
32 $msg->getLanguage()->formatComputingNumbers( $maxImageArea, 1000, "size-$1pixel" )
33 );
34
35 parent::__construct( 'thumbnail_error',
36 max( $params['width'] ?? 0, 120 ),
37 max( $params['height'] ?? 0, 120 ),
38 $msg
39 );
40 }
41
43 public function getHttpStatusCode() {
44 return 400;
45 }
46}
47
49class_alias( TransformTooBigImageAreaError::class, 'TransformTooBigImageAreaError' );
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
Basic media transform error class.
Shortcut class for parameter file size errors.