From 68ef80fb9f0c9bd204632bfdb4b157a83a8e911a Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Sat, 1 Apr 2023 14:40:19 +0200 Subject: [PATCH] PhotoMosaic: improve heuristic for landscape/portrait row --- models/PhotoMosaic.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/models/PhotoMosaic.php b/models/PhotoMosaic.php index db86be7..7cf1baa 100644 --- a/models/PhotoMosaic.php +++ b/models/PhotoMosaic.php @@ -165,7 +165,10 @@ class PhotoMosaic return [$photos, 'single']; } - // A boring set it is, then. - return [$photos, 'row']; + // Last resort: majority vote + if ($num_portrait > $num_landscape) + return [$photos, 'portraits']; + else + return [$photos, 'row']; } }