From: Jakobus Schürz Date: Wed, 15 Mar 2023 13:33:42 +0000 (+0100) Subject: use round instead of floor to make imagesize <1M possible X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=512e5900e6d2612b830f11b85e41931fe49b6248;p=friendica.git use round instead of floor to make imagesize <1M possible --- diff --git a/mod/photos.php b/mod/photos.php index 06c0d1946a..f9d4637c3a 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -1141,7 +1141,7 @@ function photos_content(App $a) '$qcomment' => $qcomment, '$rand_num' => Crypto::randomDigits(12), // Dropzone - '$max_imagesize' => floor(\Friendica\Util\Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')) / 1000000), + '$max_imagesize' => round(\Friendica\Util\Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')) / 1000000,1), ]); } } @@ -1198,7 +1198,7 @@ function photos_content(App $a) '$qcomment' => $qcomment, '$rand_num' => Crypto::randomDigits(12), // Dropzone - '$max_imagesize' => floor(Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')) / 1000000), + '$max_imagesize' => round(Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')) / 1000000,1), ]); } @@ -1274,7 +1274,7 @@ function photos_content(App $a) '$qcomment' => $qcomment, '$rand_num' => Crypto::randomDigits(12), // Dropzone - '$max_imagesize' => floor(Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')) / 1000000), + '$max_imagesize' => round(Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')) / 1000000,1), ]); } } diff --git a/src/Content/Conversation.php b/src/Content/Conversation.php index b0fd60ae3c..e660c9ff4b 100644 --- a/src/Content/Conversation.php +++ b/src/Content/Conversation.php @@ -411,7 +411,7 @@ class Conversation '$always_open_compose' => $this->pConfig->get($this->session->getLocalUserId(), 'frio', 'always_open_compose', false), // Dropzone - '$max_imagesize' => floor(\Friendica\Util\Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')) / 1000000), + '$max_imagesize' => round(\Friendica\Util\Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')) / 1000000,1), ]); diff --git a/src/Module/Item/Compose.php b/src/Module/Item/Compose.php index 2f60eebc34..1c16879765 100644 --- a/src/Module/Item/Compose.php +++ b/src/Module/Item/Compose.php @@ -242,7 +242,7 @@ class Compose extends BaseModule ]), // Dropzone - '$max_imagesize' => floor(\Friendica\Util\Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')) / 1000000), + '$max_imagesize' => round(\Friendica\Util\Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')) / 1000000,1), ]); } } diff --git a/src/Module/Post/Edit.php b/src/Module/Post/Edit.php index e28d54c9b2..403908cc02 100644 --- a/src/Module/Post/Edit.php +++ b/src/Module/Post/Edit.php @@ -186,7 +186,7 @@ class Edit extends BaseModule '$compose_link_title' => $this->t('Open Compose page'), // Dropzone - '$max_imagesize' => floor(Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')) / 1000000), + '$max_imagesize' => round(Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')) / 1000000,1), ]); return $output; } diff --git a/src/Object/Post.php b/src/Object/Post.php index 5fa9dfcf6f..c6ef5e3ba1 100644 --- a/src/Object/Post.php +++ b/src/Object/Post.php @@ -1070,7 +1070,7 @@ class Post '$indent' => $indent, '$rand_num' => Crypto::randomDigits(12), // Dropzone - '$max_imagesize' => floor(\Friendica\Util\Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')) / 1000000), + '$max_imagesize' => round(\Friendica\Util\Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')) / 1000000,1), ]); }