Calculate image size if not provided

This commit is contained in:
Michael 2023-05-09 05:59:07 +00:00
parent b692146533
commit 91a12295ff

View 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 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(); $width = $image->getWidth();
$height = $image->getHeight(); $height = $image->getHeight();