*/
class PackedImageGallery extends TraditionalImageGallery {
+ function __construct( $mode = 'traditional' ) {
+ parent::__construct( $mode );
+ // Does not support per row option.
+ $this->mPerRow = 0;
+ }
/**
* We artificially have 1.5 the resolution neccessary so that
/**
* @param File $img The file being transformed. May be false
+ * @return array
*/
protected function getThumbParams( $img ) {
if ( $img && $img->getMediaType() === MEDIATYPE_AUDIO ) {
// 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,
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();
}
protected function getModules() {
return array( 'mediawiki.page.gallery' );
}
+
+ /**
+ * Do not support per-row on packed. It really doesn't work
+ * since the images have varying widths.
+ */
+ public function setPerRow( $num ) {
+ return;
+ }
}