From 44bb501d13e7385f409edf177260d59fe4ccee1f Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Thu, 7 Jul 2022 13:55:55 +0200 Subject: [PATCH] Write new thumbnail filenames to parent Image object as well --- models/Thumbnail.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/models/Thumbnail.php b/models/Thumbnail.php index 5eb562c4..d35c2603 100644 --- a/models/Thumbnail.php +++ b/models/Thumbnail.php @@ -335,6 +335,11 @@ class Thumbnail { $thumb_selector = $this->width . 'x' . $this->height . $this->filename_suffix; $this->thumbnails[$thumb_selector] = $filename !== 'NULL' ? $filename : null; + + // For consistency, write new thumbnail filename to parent Image object. + // TODO: there could still be an inconsistency if multiple objects exists for the same image asset. + $this->image->getThumbnails()[$thumb_selector] = $this->thumbnails[$thumb_selector]; + return $success; } else