27 parent::__construct( $mode, $context );
37 private const SCALE_FACTOR = 1.5;
39 protected function getVPad( $boxHeight, $thumbHeight ) {
40 return ( $this->
getThumbPadding() + $boxHeight - $thumbHeight / self::SCALE_FACTOR ) / 2;
61 $width = $this->mHeights * 10 + 100;
66 'width' => (int)floor( $width * self::SCALE_FACTOR ),
67 'height' => (int)floor( $this->mHeights * self::SCALE_FACTOR ),
73 if ( $thumbWidth < 60 * self::SCALE_FACTOR ) {
74 $thumbWidth = 60 * self::SCALE_FACTOR;
86 $thumbWidth = $thumb ? $thumb->getWidth() : $this->mWidths * self::SCALE_FACTOR;
93 $imageParameters[
'override-width'] = ceil( $thumb->getWidth() / self::SCALE_FACTOR );
94 $imageParameters[
'override-height'] = ceil( $thumb->getHeight() / self::SCALE_FACTOR );
103 return [
'mediawiki.page.gallery' ];
getThumbPadding()
How much padding the thumb has between the image and the inner div that contains the border.
getVPad( $boxHeight, $thumbHeight)
Get vertical padding for a thumbnail.
getModules()
Add javascript which auto-justifies the rows by manipulating the image sizes.
getThumbDivWidth( $thumbWidth)
Get the width of the inner div that contains the thumbnail in question.
setPerRow( $num)
Do not support per-row on packed.
__construct( $mode='traditional', ?IContextSource $context=null)
Create a new image gallery object.
adjustImageParameters( $thumb, &$imageParameters)
Adjust the image parameters for a thumbnail.
Interface for objects which can provide a MediaWiki context on request.