You've already forked AstralRinth
Fix larger gallery image uploading (#4292)
This reconciles a couple of differences between the frontend and backend regarding gallery image uploads. - Frontend: The frontend thought that the limit should be 500 MiB for gallery images. This is obviously not right. It has been updated to 5 MiB. - Backend: The backend has been rejecting anything between 2 MiB and 5 MiB, but this is inconsistent with prior usage, where the limit used to be 5 MiB. It has been updated to allow anything under 5 MiB. Fixes #4291
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
class="iconified-button raised-button"
|
class="iconified-button raised-button"
|
||||||
prompt="Replace"
|
prompt="Replace"
|
||||||
:accept="acceptFileTypes"
|
:accept="acceptFileTypes"
|
||||||
:max-size="524288000"
|
:max-size="5242880"
|
||||||
should-always-reset
|
should-always-reset
|
||||||
aria-label="Replace image"
|
aria-label="Replace image"
|
||||||
@change="
|
@change="
|
||||||
@@ -197,7 +197,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div v-if="currentMember" class="card header-buttons">
|
<div v-if="currentMember" class="card header-buttons">
|
||||||
<FileInput
|
<FileInput
|
||||||
:max-size="524288000"
|
:max-size="5242880"
|
||||||
:accept="acceptFileTypes"
|
:accept="acceptFileTypes"
|
||||||
prompt="Upload an image"
|
prompt="Upload an image"
|
||||||
aria-label="Upload an image"
|
aria-label="Upload an image"
|
||||||
|
|||||||
@@ -503,8 +503,8 @@ async fn project_create_inner(
|
|||||||
if let Some(item) = gallery_items.iter().find(|x| x.item == name) {
|
if let Some(item) = gallery_items.iter().find(|x| x.item == name) {
|
||||||
let data = read_from_field(
|
let data = read_from_field(
|
||||||
&mut field,
|
&mut field,
|
||||||
2 * (1 << 20),
|
5 * (1 << 20),
|
||||||
"Gallery image exceeds the maximum of 2MiB.",
|
"Gallery image exceeds the maximum of 5MiB.",
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
|
|||||||
@@ -1739,8 +1739,8 @@ pub async fn add_gallery_item(
|
|||||||
|
|
||||||
let bytes = read_limited_from_payload(
|
let bytes = read_limited_from_payload(
|
||||||
&mut payload,
|
&mut payload,
|
||||||
2 * (1 << 20),
|
5 * (1 << 20),
|
||||||
"Gallery image exceeds the maximum of 2MiB.",
|
"Gallery image exceeds the maximum of 5MiB.",
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user