Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Tune Space post image compression

Anand Baburajanc611338d629c
diff --git a/rust/space/src/client.rs b/rust/space/src/client.rs
index 1b2e0ddda1..c60085b53d 100644
--- a/rust/space/src/client.rs
+++ b/rust/space/src/client.rs
@@ -41,7 +41,7 @@ const UPLOAD_PURPOSE_COVER: &str = "cover";
const MESSAGE_KIND_REGULAR: &str = "regular";
const MESSAGE_KIND_POST_REPLY: &str = "post_reply";
const ONLY_PHOTOS_UPLOAD_MESSAGE: &str = "only photos can be uploaded";
-pub const MAX_SPACE_POST_UPLOAD_BYTES: usize = 10 * 1024 * 1024;
+pub const MAX_SPACE_POST_UPLOAD_BYTES: usize = 5 * 1024 * 1024;
pub const MAX_SPACE_AVATAR_UPLOAD_BYTES: usize = 2 * 1024 * 1024;
pub const MAX_SPACE_COVER_UPLOAD_BYTES: usize = 2 * 1024 * 1024;
pub const MAX_SPACE_POST_PLAINTEXT_BYTES: usize =
diff --git a/server/space/controller/assets.go b/server/space/controller/assets.go
index 40eb33df4e..847c870e1c 100644
--- a/server/space/controller/assets.go
+++ b/server/space/controller/assets.go
@@ -21,7 +21,7 @@ import (
)
const (
- maxPostUploadBytes int64 = 10 * 1024 * 1024
+ maxPostUploadBytes int64 = 5 * 1024 * 1024
maxAvatarUploadBytes int64 = 2 * 1024 * 1024
maxCoverUploadBytes int64 = 2 * 1024 * 1024
uploadURLExpiry = 15 * time.Minute
diff --git a/web/apps/space/src/utils/spacePostImage.ts b/web/apps/space/src/utils/spacePostImage.ts
index 6e1c12673d..42c64c6bd5 100644
--- a/web/apps/space/src/utils/spacePostImage.ts
+++ b/web/apps/space/src/utils/spacePostImage.ts
@@ -39,13 +39,13 @@ export const spaceDefaultCoverImagePath = "/images/default-cover-image.png";
export const spaceProfileCoverAspectRatio = 39 / 17;
const spaceAvatarImageMaxEdge = 512;
const spaceCoverImageMaxWidth = 1170;
-const spacePostImageMaxLongEdge = 2560;
-const spacePostImageWebPQuality = 0.85;
+const spacePostImageMaxLongEdge = 1600;
+const spacePostImageWebPQuality = 0.82;
const spacePostImageMimeType = "image/webp";
const spaceAssetEncryptionOverheadBytes = 42;
const spaceAvatarUploadMaxBytes = 2 * 1024 * 1024;
const spaceCoverUploadMaxBytes = 2 * 1024 * 1024;
-const spacePostUploadMaxBytes = 10 * 1024 * 1024;
+const spacePostUploadMaxBytes = 5 * 1024 * 1024;
export const maxSpaceAvatarImageBytes =
spaceAvatarUploadMaxBytes - spaceAssetEncryptionOverheadBytes;