use Friendica\Core\L10n;
use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Database\Database;
+use Friendica\DI;
use Friendica\Model\Photo;
use Friendica\Model\User;
use Friendica\Module\BaseApi;
$width = $image->getWidth();
$height = $image->getHeight();
- $maximagesize = $this->config->get('system', 'maximagesize');
+ $maximagesize = Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize'));
+
+ if ($maximagesize == 0) {
+ $maximagesize = INF;
+ }
if (!empty($maximagesize) && $filesize > $maximagesize) {
// Scale down to multiples of 640 until the maximum size isn't exceeded anymore
$filetype = Images::getMimeTypeBySource($src, $filename, $filetype);
- $maximagesize = DI::config()->get('system', 'maximagesize', 0);
+ $maximagesize = Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize', 0));
+
+ if ($maximagesize == 0) {
+ $maximagesize = INF;
+ }
if ($maximagesize && $filesize > $maximagesize) {
DI::sysmsg()->addNotice(DI::l10n()->t('Image exceeds size limit of %s', Strings::formatBytes($maximagesize)));