*/
class PackedImageGallery extends TraditionalImageGallery {
-
function __construct( $mode = 'traditional' ) {
parent::__construct( $mode );
// Does not support per row option.
/**
* @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();
}