]> git.mxchange.org Git - friendica.git/commitdiff
use round instead of floor to make imagesize <1M possible
authorJakobus Schürz <jakobus.schuerz@schuerz.at>
Wed, 15 Mar 2023 13:33:42 +0000 (14:33 +0100)
committerJakobus Schürz <jakobus.schuerz@schuerz.at>
Sun, 19 Mar 2023 17:52:45 +0000 (18:52 +0100)
mod/photos.php
src/Content/Conversation.php
src/Module/Item/Compose.php
src/Module/Post/Edit.php
src/Object/Post.php

index 06c0d1946a370dfa37c236dd9890e1d88315c056..f9d4637c3a6ae81fa01db7a81940ed6cf41f633f 100644 (file)
@@ -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),
                                                ]);
                                        }
                                }
index b0fd60ae3c59629f82fdf9082ab86b229f47d53e..e660c9ff4b843e2beecb9fcd42fd264916856091 100644 (file)
@@ -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),
 
                ]);
 
index 2f60eebc343e756060cb8f8f599fdca1b4f578d4..1c1687976592c5573cd651e92339d9fe94aa52b7 100644 (file)
@@ -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),
                ]);
        }
 }
index e28d54c9b2ce22343822e70a7cd4144c7ed9dd91..403908cc020bce9e8d8f45f3909f564a8db43b0c 100644 (file)
@@ -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;
        }
index 5fa9dfcf6fb78ea40abf2ac6e91d1141eec9ce30..c6ef5e3ba1b1e15d199538aedd4fc5a358dc261e 100644 (file)
@@ -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),
                        ]);
                }