$image->scaleToSquare(300);
$filesize = strlen($image->asString());
- $maximagesize = DI::config()->get('system', 'maximagesize');
+ $maximagesize = Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize'));
if (!empty($maximagesize) && ($filesize > $maximagesize)) {
Logger::info('Avatar exceeds image limit', ['uid' => $uid, 'cid' => $cid, 'maximagesize' => $maximagesize, 'size' => $filesize, 'type' => $image->getType()]);
if ($image->getType() == 'image/gif') {
$width = $image->getWidth();
$height = $image->getHeight();
- $maximagesize = DI::config()->get('system', 'maximagesize');
+ $maximagesize = Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize'));
if (!empty($maximagesize) && ($filesize > $maximagesize)) {
// Scale down to multiples of 640 until the maximum size isn't exceeded anymore