-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check for FreeType functions required for avatars #7480
Conversation
* @return bool | ||
*/ | ||
protected function hasFreeTypeSupport() { | ||
if (function_exists('imagettfbbox') && function_exists('imagettftext')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer the shorter version
return function_exists('imagettfbbox') && function_exists('imagettftext');
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fair enough
Codecov Report
@@ Coverage Diff @@
## master #7480 +/- ##
============================================
+ Coverage 51.11% 51.11% +<.01%
- Complexity 24901 24903 +2
============================================
Files 1601 1601
Lines 94774 94778 +4
Branches 1367 1368 +1
============================================
+ Hits 48441 48444 +3
- Misses 46333 46334 +1
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on a system without FreeType support enabled and works as expected 👍
I have noticed, though, that not having FreeType support affects other elements besides just the avatars, for example the user settings UI (if you create a user or modify a user setting the UI will not be updated, although if you refresh the page you can see that it was modified as expected).
Maybe the error message should be something like "This will result in broken avatars and user settings UI" instead ("will" instead of "can" and "user settings UI" included in the message too)?
@danxuliu I don't have a preference. Feel free to change the wording :) |
@danxuliu slightly improved:
(We call it »profile picture« in the settings, should not use »avatar« anywhere. Also, no technical abbreviation like »UI«.) |
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
I have amended the commits with @jancborchardt suggestion, thanks! |
Fixes #7454