]> git.mxchange.org Git - friendica.git/commitdiff
Calculate image size if not provided
authorMichael <heluecht@pirati.ca>
Tue, 9 May 2023 05:59:07 +0000 (05:59 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 9 May 2023 05:59:07 +0000 (05:59 +0000)
src/Model/Photo.php

index ff29a13fc7c1876cd2c1c34e60c72cd48d063198..0df45af22e3d3ab582517d07f88925f92a91c77c 100644 (file)
@@ -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();