This avatar was randomly generated when I created an organization yesterday.
This is the second time we have been notified about something like this from the generator (after some thousand random avatars).
Of course this is very discomforting, even if happening only at very low frequency. We started the avatar project https://codeberg.org/codeberg/avatars which is a port of https://avatars.dicebear.com/ from typescript to go.
If anybody has time for UI integration into gitea, this might make a nice project. All contributions welcome!
Can't you make the go app servable, and then set the config option GRAVATAR_SOURCE, like described in the gitea config?
GRAVATAR_SOURCE: gravatar: Can be gravatar, duoshuo or anything like http://cn.gravatar.com/avatar/.
Not familiar with go, so not sure what's needed here.
First of all, I came to report here because the upstream issue is locked and my work is unrelated to Codeberg/Community#394.
Not sure if my attempt in the past few days were worth it, but I talked to the developer of the library currently used in Gitea (in Chinese though – the whole lib is commented in Chinese, and I'm taking the responsibility to maintain my fork) about the viability to modify/tweak the library for as a drop-in replacement in the current code base of Gitea.
What I'm aiming at, for the time being, is to keep the algorithm largely as is (as @zeripath summarized in upstream https://github.com/go-gitea/gitea/issues/14799#issuecomment-786107766, while not following his advice to change the order of generation), but try to work on the blocks to make sure it is visually complex, including as few rectangular elements as possible, and make the center take up more space to dilute the effect of the rotating edges (inspired by this blog post – it seems WordPress dealt with the issue in this way). The goal is to have this also be the local replacement of Gravatar et al. for use in e. g. Codeberg.
The result is, both of us have made some changes to the existing code. The upstream developer gave me some advice in making it more like the design of Gravatar identicon (original design from WordPress), while he also took a look into the code himself and made a few tweaks to the previous implementation from 6 years ago, refactored it, and added a few new image building blocks that I happen to like and have chosen to include in my fork. Now my code is API compatibile with the upstream's latest version, meaning that merging upstream changes are easy, while new modifications could be done at the side of Gitea (or, if I may, under my maintenance at your request, should issues emerge from my modification, such as if there are still unwelcomed icons getting generated).
To demonstrate my work, here is a batch of test data produced by running
go test on my forked repo:
AFAICT upstream discussed an option to easily switch avatar generators and therefore a diversity of options would probably be desirable, so thank you for your work here.
An idea for Codeberg might be a middleware that randomly chooses a generator. If icons are from one generator, they are usually quite similar (no matter if dicebears or this thingy). I would find it quite funny if we had the additional diversity of many default generators.
By the way, I was also looking forward to other generators because the current one creates some graphical issues (I noticed there are sometimes random spaces between parts of the image, but not really regularly but only on the right side for example or some gapps on one side are larger etc) - did you notice this as well or did you make such improvements (may be by coincidence)?
did you notice this as well or did you make such improvements (may be by coincidence)?
Yes, I did. The aforementioned discussion (here: https://github.com/issue9/identicon/issues/6, unfortunately in Chinese) is actually titled "Wish to have an option to remove borders" (as in surrounding each block). The most significant improvement by the author was to use integer values instead of floating point, as there isn't dithering or interpolation involved anyway. Another was to allow points on the borders of each polygon to be included while drawing (previously only those truely inside the borders were drawn in forground color). After those changes (plus my own change to remove the intentional borders around sqares), this has become a non-issue.
You can refer to the individual commits in my repo regarding this. Upstream is kept at 3x3, so a remainder is still kept as a gap on the right (still a big improvement as there won't be rounding errors anymore). I chose to use 4x4 to eliminate that problem as well.
I would find it quite funny if we had the additional diversity of many default generators.
Gitea does support many generators out of the box, most importantly the Libravatar service (free and open-source, now sponsored by the Fedora project). They are all disabled in Codeberg, presumably for maximum freedom (Gravatar is non-free), reliability (Gravatar is inaccessible from Mainland China, the once suggested Chinese alternative has been shut down, and Libravatar was once to be shut down as well) and simply for being standalone. I believe my fork as a drop-in replacement of the existing library could at least be a fall-back solution for its simplicity (Note that both Libravatar and Gravatar support multiple fall-back algorithms when the input hash has no custom avatar associated with it).
I was talking about having multiple integrated generators at the same time, not about enabling more 3rd party services.
This way, the default / fallback avatars would have a lot more diversity and you could remember users better because they don't just have different colours or some slightly different patterns, but there are users that look completely different by default.
Of course, that's also what upstream (notably @6543) is planning for, though some have expressed concerns on the potential controversy of DiceBear avatars in the upstream issue, which I totally understand.
Anyway, I crafted three avatars by hand just now. They don't happen to raise your concern, do they?
@CL-Jeremy : have you seen the work on alternative avatar generators for 1.14? Would it make sense to join contributions to avoid diverging efforts?
I sure have. I mean, isn't this repo a candidate for that 😆. I just don't want to give up on the original library so soon. I like the geometric design a lot since it came out a decade ago and personally don't want to deprecate it.
Also, I'm just saying this, but I'm relatively new to coding Go. My previous contributions to Gitea focused specifically on frontend and I haven't got much understanding of Gitea's architechture to integrate things (I suppose it won't be hard, and other contributors at upstream just haven't really gone though the decision process on how it should be done). I've worked on the said library to partly to practise as it's relatively straightforward to me.
Deleting a branch is permanent. It CANNOT be undone. Continue?