PhotoMosaic: add sixLandscapes layout, combining side and row

This commit is contained in:
Aaron van Geffen 2023-12-02 01:29:11 +01:00
parent d42c3c142c
commit efb35cfd6a
2 changed files with 11 additions and 0 deletions

View File

@ -32,6 +32,10 @@ class PhotoMosaic
// Single panorama
'panorama' => [Image::TYPE_PANORAMA],
// A whopping six landscapes?
'sixLandscapes' => [Image::TYPE_LANDSCAPE, Image::TYPE_LANDSCAPE, Image::TYPE_LANDSCAPE,
Image::TYPE_LANDSCAPE, Image::TYPE_LANDSCAPE, Image::TYPE_LANDSCAPE],
// Big-small juxtapositions
'sidePortrait' => [Image::TYPE_PORTRAIT, Image::TYPE_LANDSCAPE, Image::TYPE_LANDSCAPE,
Image::TYPE_LANDSCAPE, Image::TYPE_LANDSCAPE],

View File

@ -137,6 +137,13 @@ class PhotosIndex extends Template
}
}
protected function sixLandscapes(array $photos, $altLayout)
{
$chunks = array_chunk($photos, 3);
$this->sideLandscape($chunks[0], $altLayout);
$this->threeLandscapes($chunks[1], $altLayout);
}
protected function sidePortrait(array $photos, $altLayout)
{
$image = array_shift($photos);