From 1981cb76622977ed3a0a480bfcb427b09ca3c688 Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Thu, 21 Jul 2016 00:37:43 +0200 Subject: [PATCH] Select the first generated thumbnail, which should be the proper size ...most of the time. If all works well. --- classes/File_thumbnail.php | 1 + 1 file changed, 1 insertion(+) diff --git a/classes/File_thumbnail.php b/classes/File_thumbnail.php index 968883f2b8..91ba653744 100644 --- a/classes/File_thumbnail.php +++ b/classes/File_thumbnail.php @@ -98,6 +98,7 @@ class File_thumbnail extends Managed_DataObject if ($notNullUrl) { $thumb->whereAdd('url IS NOT NULL'); } + $thumb->orderBy('modified ASC'); // the first created, a somewhat ugly hack $thumb->limit(1); if (!$thumb->find(true)) { throw new NoResultException($thumb); -- 2.39.5