Merge pull request #12333 from annando/issue-12327

Issue 12327: Convert avatars to static
This commit is contained in:
Hypolite Petovan 2022-12-04 23:30:58 -05:00 committed by GitHub
commit 32a9f39768
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 31 additions and 8 deletions

View file

@ -23,7 +23,6 @@ namespace Friendica\Module;
use Friendica\BaseModule;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\APContact;
use Friendica\Model\User;

View file

@ -182,6 +182,12 @@ class Photo extends BaseModule
throw new HTTPException\InternalServerErrorException($error);
}
if (!empty($request['static'])) {
$img = new Image($imgdata, $photo['type']);
$img->toStatic();
$imgdata = $img->asString();
}
// if customsize is set and image is not a gif, resize it
if ($photo['type'] !== 'image/gif' && $customsize > 0 && $customsize <= Proxy::PIXEL_THUMB && $square_resize) {
$img = new Image($imgdata, $photo['type']);