From: Michael Date: Tue, 9 May 2023 05:59:07 +0000 (+0000) Subject: Calculate image size if not provided X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=91a12295ffbc7b8091974024c311d804729077b4;p=friendica.git Calculate image size if not provided --- 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();