From 91a12295ffbc7b8091974024c311d804729077b4 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 9 May 2023 05:59:07 +0000 Subject: [PATCH] Calculate image size if not provided --- src/Model/Photo.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Model/Photo.php b/src/Model/Photo.php index ff29a13fc7..0df45af22e 100644 --- a/src/Model/Photo.php +++ b/src/Model/Photo.php @@ -1241,6 +1241,10 @@ class Photo */ public static function storeWithPreview(Image $image, int $uid, string $resource_id, string $filename, int $filesize, string $album, string $description, string $allow_cid, string $allow_gid, string $deny_cid, string $deny_gid): int { + if ($filesize == 0) { + $filesize = strlen($image->asString()); + } + $width = $image->getWidth(); $height = $image->getHeight(); -- 2.39.5