fix: gif emoji uploading
fix: external image proxy
This commit is contained in:
parent
275dd0a1eb
commit
8e241b3435
5 changed files with 17 additions and 20 deletions
|
@ -191,7 +191,7 @@
|
|||
id="avatar_file"
|
||||
name="file"
|
||||
type="file"
|
||||
accept="image/png,image/jpeg,image/avif,image/webp"
|
||||
accept="image/png,image/jpeg,image/avif,image/webp,image/gif"
|
||||
class="w-content"
|
||||
/>
|
||||
|
||||
|
|
|
@ -447,12 +447,9 @@
|
|||
<li>Use custom CSS on your profile</li>
|
||||
<li>
|
||||
Ability to use community emojis outside of
|
||||
their community <b>(soon)</b>
|
||||
</li>
|
||||
<li>
|
||||
Ability to upload and use gif emojis
|
||||
<b>(soon)</b>
|
||||
their community
|
||||
</li>
|
||||
<li>Ability to upload and use gif emojis</li>
|
||||
<li>Create infinite stack timelines</li>
|
||||
</ul>
|
||||
|
||||
|
|
|
@ -141,16 +141,18 @@ pub async fn create_request(
|
|||
.await
|
||||
{
|
||||
Ok(_) => {
|
||||
if let Err(e) = save_buffer(
|
||||
&upload.path(&data.0).to_string(),
|
||||
img.0.to_vec(),
|
||||
if is_animated {
|
||||
ImageFormat::Gif
|
||||
} else {
|
||||
ImageFormat::WebP
|
||||
},
|
||||
) {
|
||||
return Json(Error::MiscError(e.to_string()).into());
|
||||
if is_animated {
|
||||
if let Err(e) = upload.write(&data.0, &img.0) {
|
||||
return Json(Error::MiscError(e.to_string()).into());
|
||||
}
|
||||
} else {
|
||||
if let Err(e) = save_buffer(
|
||||
&upload.path(&data.0).to_string(),
|
||||
img.0.to_vec(),
|
||||
ImageFormat::WebP,
|
||||
) {
|
||||
return Json(Error::MiscError(e.to_string()).into());
|
||||
}
|
||||
}
|
||||
|
||||
Json(ApiReturn {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue