Skip to content

Commit

Permalink
fix: add Arabic font support and SVG upload
Browse files Browse the repository at this point in the history
  • Loading branch information
BasselArt committed Dec 29, 2024
1 parent 31108ef commit c811aed
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions app/handlers/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,17 @@ func Gravatar() web.HandlerFunc {
name = "?"
}

// Extract and draw letter avatar
extractedLetter := letteravatar.Extract(name)
// URL decode the name (matching LetterAvatar behavior)
decodedName, err := url.QueryUnescape(name)
if err != nil {
log.Error(c, err)
return c.Failure(err)
}

// Use the same mechanism as LetterAvatar
extractedLetter := letteravatar.Extract(decodedName)
img, err := letteravatar.Draw(size, extractedLetter, &letteravatar.Options{
PaletteKey: fmt.Sprintf("%d:%s", id, name),
PaletteKey: fmt.Sprintf("%s:%s", fmt.Sprint(id), decodedName),
})
if err != nil {
log.Error(c, err)
Expand Down

0 comments on commit c811aed

Please sign in to comment.