You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
forgejo/templates
wxiaoguang 82224c54e0
Improve avatar uploading / resizing / compressing, remove Fomantic card module (#24653)
Fixes: #8972
Fixes: #24263

And I think it also (partially) fix #24263 (no need to convert) ,
because users could upload any supported image format if it isn't larger
than AVATAR_MAX_ORIGIN_SIZE


The main idea: 

* if the uploaded file size is not larger than AVATAR_MAX_ORIGIN_SIZE,
use the origin
* if the resized size is larger than the origin, use the origin

Screenshots:

JPG:

<details>


![image](https://github.com/go-gitea/gitea/assets/2114189/70e98bb0-ecb9-4c4e-a89f-4a37d4e37f8e)

</details>

APNG:

<details>


![image](https://github.com/go-gitea/gitea/assets/2114189/9055135b-5e2d-4152-bd72-596fcb7c6671)


![image](https://github.com/go-gitea/gitea/assets/2114189/50364caf-f7f6-4241-a289-e485fe4cd582)

</details>

WebP (animated)

<details>


![image](https://github.com/go-gitea/gitea/assets/2114189/f642eb85-498a-49a5-86bf-0a7b04089ae0)

</details>

The only exception: if a WebP image is larger than MaxOriginSize and it
is animated, then current `webp` package can't decode it, so only in
this case it isn't supported. IMO no need to support such case: why a
user would upload a 1MB animated webp as avatar? crazy .....

---------

Co-authored-by: silverwind <me@silverwind.io>
1 year ago
..
admin Improve queue & process & stacktrace (#24636) 1 year ago
api/packages/pypi Remove incorrect HTML self close tag (#23748) 1 year ago
base Improve template system and panic recovery (#24461) 1 year ago
code Use data-tooltip-content for tippy tooltip (#23649) 1 year ago
custom Add footer extra links template (#9576) 5 years ago
devtest Improve some modal action buttons (#24289) 1 year ago
explore Change `join_on` translation to `joined_on` and include placeholder for the date (#24550) 1 year ago
mail Remove incorrect HTML self close tag (#23748) 1 year ago
org Remove svg.svg class, restore .rss-icon (#24667) 1 year ago
package Add Alpine package registry (#23714) 1 year ago
projects Update pin and add pin-slash (#24669) 1 year ago
repo Add markdown preview to Submit Review Textarea (#24672) 1 year ago
shared Display owner of a runner as a tooltip instead of static text (#24377) 1 year ago
status Improve template system and panic recovery (#24461) 1 year ago
swagger Add Alpine package registry (#23714) 1 year ago
user Improve avatar uploading / resizing / compressing, remove Fomantic card module (#24653) 1 year ago
home.tmpl Improve home page template, fix Sort dropdown menu flash (#23856) 1 year ago
install.tmpl Remove incorrect HTML self close tag (#23748) 1 year ago
post-install.tmpl Remove incorrect HTML self close tag (#23748) 1 year ago