Skip to content
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

White avatar image throws javascript errors on profile page #2714

Closed
clarkwinkelmann opened this issue Mar 19, 2021 · 1 comment · Fixed by #3119
Closed

White avatar image throws javascript errors on profile page #2714

clarkwinkelmann opened this issue Mar 19, 2021 · 1 comment · Fixed by #3119
Assignees
Milestone

Comments

@clarkwinkelmann
Copy link
Member

Bug Report

Current Behavior
Setting a completely white image as an avatar results in this.getPalette(...) is null errors thrown in the javascript console.

I don't think this will interfere with the page rendering, because it happens inside of the async onload callback in https://github.com/flarum/core/blob/9627eb73f103fae4dff1680cc5f972277db6cae7/js/src/common/models/User.js#L93

but it floods the console with errors.

Steps to Reproduce

  1. Create a completely white PNG image of any width and height (other formats might also work)
  2. Set as avatar
  3. Observe error in console for both the user itself and guests visiting the profile

Expected Behavior
The error should be silenced.

Environment

  • Flarum version: beta 16, probably earlier as well
  • Website URL: localhost, likely all
  • Browser: Firefox, likely others

Possible Solution
Ideally this should be fixed or better handled in the color-thief library so we don't need to catch a null error from inside their library.

However there are issues opened about this on their repo since 2015 and there doesn't seem to be much activity.

I have added a comment to the older of the issues I could find lokesh/color-thief#40

If ColorThief doesn't make any change, the easiest solution for us would probably be to just catch and silence any error that results from calling ColorThief.

@stale
Copy link

stale bot commented Jun 22, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We do this to keep the amount of open issues to a manageable minimum.
In any case, thanks for taking an interest in this software and contributing by opening the issue in the first place!

@stale stale bot added the stale Issues that have had over 90 days of inactivity label Jun 22, 2021
@askvortsov1 askvortsov1 self-assigned this Oct 22, 2021
@askvortsov1 askvortsov1 added this to the 1.2 milestone Oct 25, 2021
@SychO9 SychO9 removed the stale Issues that have had over 90 days of inactivity label Nov 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants