diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2014-12-27 15:41:37 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2014-12-31 11:43:28 +0100 |
commit | c1f9b1f7b1b77776192048005dcc66dcf3df2bfb (patch) | |
tree | 2b38796e738dd74cb42ecd9bfd151803108386bc /includes/gallery/PackedImageGallery.php | |
parent | b88ab0086858470dd1f644e64cb4e4f62bb2be9b (diff) |
Update to MediaWiki 1.24.1
Diffstat (limited to 'includes/gallery/PackedImageGallery.php')
-rw-r--r-- | includes/gallery/PackedImageGallery.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/includes/gallery/PackedImageGallery.php b/includes/gallery/PackedImageGallery.php index 963ee6b9..52a49ddb 100644 --- a/includes/gallery/PackedImageGallery.php +++ b/includes/gallery/PackedImageGallery.php @@ -21,7 +21,6 @@ */ class PackedImageGallery extends TraditionalImageGallery { - function __construct( $mode = 'traditional' ) { parent::__construct( $mode ); // Does not support per row option. @@ -49,6 +48,7 @@ class PackedImageGallery extends TraditionalImageGallery { /** * @param File $img The file being transformed. May be false + * @return array */ protected function getThumbParams( $img ) { if ( $img && $img->getMediaType() === MEDIATYPE_AUDIO ) { @@ -58,6 +58,7 @@ class PackedImageGallery extends TraditionalImageGallery { // factor, so use random big number. $width = $this->mHeights * 10 + 100; } + // self::SCALE_FACTOR so the js has some room to manipulate sizes. return array( 'width' => $width * self::SCALE_FACTOR, @@ -70,14 +71,18 @@ class PackedImageGallery extends TraditionalImageGallery { if ( $thumbWidth < 60 * self::SCALE_FACTOR ) { $thumbWidth = 60 * self::SCALE_FACTOR; } + return $thumbWidth / self::SCALE_FACTOR + $this->getThumbPadding(); } /** - * @param MediaTransformOutput|bool $thumb the thumbnail, or false if no thumb (which can happen) + * @param MediaTransformOutput|bool $thumb The thumbnail, or false if no + * thumb (which can happen) + * @return float */ protected function getGBWidth( $thumb ) { $thumbWidth = $thumb ? $thumb->getWidth() : $this->mWidths * self::SCALE_FACTOR; + return $this->getThumbDivWidth( $thumbWidth ) + $this->getGBPadding(); } @@ -90,6 +95,7 @@ class PackedImageGallery extends TraditionalImageGallery { /** * Add javascript which auto-justifies the rows by manipulating the image sizes. * Also ensures that the hover version of this degrades gracefully. + * @return array */ protected function getModules() { return array( 'mediawiki.page.gallery' ); @@ -98,6 +104,7 @@ class PackedImageGallery extends TraditionalImageGallery { /** * Do not support per-row on packed. It really doesn't work * since the images have varying widths. + * @param int $num */ public function setPerRow( $num ) { return; |