Skip to content

Use TTF fonts for avatar generation - #8428

Merged
rullzer merged 2 commits into
masterfrom
fix_8189
Feb 19, 2018
Merged

Use TTF fonts for avatar generation#8428
rullzer merged 2 commits into
masterfrom
fix_8189

Conversation

@rullzer

Copy link
Copy Markdown
Member

Fixes#8189

Use ttf fonts for avatar generation. So it also works on CentOS

Could any of you test this (should apply pretty easy on 13): @Temtaime@tmaff@dec1pher @MrLordy @splitt3r

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
@thegcat

Copy link
Copy Markdown

I had the same issue in the same circumstances and this seems to have fixed the issue for see, thanks!

@ghost

Copy link
Copy Markdown

Fixed the issue. Thanks!

@rullzer

Copy link
Copy Markdown
MemberAuthor

Thanks for testing! I'll make sure this also lands in 13.0.1

@ChristophWurstChristophWurst left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't test but makes sense to use these fonts if that fixes the issue with Centos

@splitt3r

Copy link
Copy Markdown
Contributor

Fixed the issue for me too 👍

@rullzer
rullzer merged commit 26a741f into masterFeb 19, 2018
@rullzer
rullzer deleted the fix_8189 branch February 19, 2018 21:12
@Franck2A

Copy link
Copy Markdown

In my side, the patch fixed the message error log but still no profil letter avatar.
RHEL 7.4 (CENTOS)

@rullzer

Copy link
Copy Markdown
MemberAuthor

@Franck2A did you change the display name of the user? So the avatar gets regenerated?

@Franck2A

Copy link
Copy Markdown

@rullzer Tnx for your response, how to change display name ? I'm using ldap authenticated.
Please help, regards

@splitt3r

Copy link
Copy Markdown
Contributor

You could also upload a dummy avatar and delete it so the default one gets regenerated. Did the job for me.

@Franck2A

Copy link
Copy Markdown

@splitt3r Tnx that's work find on my account. Is it possible to do it massively for all accounts ?
Regards

@susadm

Copy link
Copy Markdown

Not working for me :(
Centos 7 NExtcloud 13
After downloading the fonts and changing the Avatar.ini there are still no letters and the error is still present

imagettftext(): Could not read font at /var/www/html/nextcloud/lib/private/Avatar.php#2662018-02-21T14:16:31+0100
ErrorPHP

I have changed the name of an user and created a new one...

drwxr-xr-x. 2 apache apache 4096 Feb 21 13:57 .
drwxr-xr-x. 17 apache apache 4096 Feb 10 21:29 ..
-rw-r--r--. 1 apache apache 11560 Feb 10 21:29 LICENSE.txt
-rw-r--r--. 1 apache apache 156148 Feb 21 13:56 OpenSans-Light.ttf
-rw-r--r--. 1 apache apache 62844 Feb 10 21:29 OpenSans-Light.woff
-rw-r--r--. 1 apache apache 217360 Feb 10 21:29 OpenSans-Regular.ttf
-rw-r--r--. 1 apache apache 20544 Feb 10 21:29 OpenSans-Regular.woff
-rw-r--r--. 1 apache apache 156735 Feb 21 13:57 OpenSans-Semibold.ttf
-rw-r--r--. 1 apache apache 69888 Feb 10 21:29 OpenSans-Semibold.woff

Avater.ini

$background = imagecolorallocate($im, $backgroundColor[0], $backgroundColor[1], $backgroundColor[2]);
$white = imagecolorallocate($im, 255, 255, 255);
imagefilledrectangle($im, 0, 0, $size, $size, $background);

 $font = __DIR__ . '/../../core/fonts/OpenSans-Semibold.ttf';
$fontSize = $size * 0.4;
$box = imagettfbbox($fontSize, 0, $font, $text);
$x = ($size - ($box[2] - $box[0])) / 2;
$y = ($size - ($box[1] - $box[7])) / 2;
$x += 1;

any Idea?

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@rullzer@thegcat@splitt3r@Franck2A@susadm@ChristophWurst