+ if ( !$this->getID() && $wgSend404Code ) {
+ // If there is no image, no shared image, and no description page,
+ // output a 404, to be consistent with articles.
+ $wgRequest->response()->header( 'HTTP/1.1 404 Not Found' );
+ }
+ }
+ $wgOut->setFileVersion( $this->displayImg );
+ }
+
+ /**
+ * Creates an thumbnail of specified size and returns an HTML link to it
+ * @param $params array Scaler parameters
+ * @param $width int
+ * @param $height int
+ * @return string
+ */
+ private function makeSizeLink( $params, $width, $height ) {
+ $params['width'] = $width;
+ $params['height'] = $height;
+ $thumbnail = $this->displayImg->transform( $params );
+ if ( $thumbnail && !$thumbnail->isError() ) {
+ return Html::rawElement( 'a', array(
+ 'href' => $thumbnail->getUrl(),
+ 'class' => 'mw-thumbnail-link'
+ ), wfMessage( 'show-big-image-size' )->numParams(
+ $thumbnail->getWidth(), $thumbnail->getHeight()
+ )->parse() );
+ } else {
+ return '';