Merge pull request #37482 from nextcloud/backport/37378/stable26

[stable26] fix the avatar generation on Alpine Linux
This commit is contained in:
Simon L 2023-03-31 09:07:22 +02:00 committed by GitHub
commit d5360c86b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -129,6 +129,11 @@ abstract class Avatar implements IAvatar {
if (!extension_loaded('imagick')) {
return null;
}
$formats = Imagick::queryFormats();
// Avatar generation breaks if RSVG format is enabled. Fall back to gd in that case
if (in_array("RSVG", $formats, true)) {
return null;
}
try {
$font = __DIR__ . '/../../../core/fonts/NotoSans-Regular.ttf';
$svg = $this->getAvatarVector($size, $darkTheme);