From 2cb03dc1f4e01ba491c36caff30c33fe9c5bad89 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 6 Apr 2021 17:01:35 +0200 Subject: Add banners support --- server/initializers/constants.ts | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'server/initializers') diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index 3f934688b..1e74f3eab 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts @@ -305,7 +305,7 @@ const CONSTRAINTS_FIELDS = { PUBLIC_KEY: { min: 10, max: 5000 }, // Length PRIVATE_KEY: { min: 10, max: 5000 }, // Length URL: { min: 3, max: 2000 }, // Length - AVATAR: { + IMAGE: { EXTNAME: [ '.png', '.jpeg', '.jpg', '.gif', '.webp' ], FILE_SIZE: { max: 2 * 1024 * 1024 // 2MB @@ -466,6 +466,8 @@ const MIMETYPES = { IMAGE: { MIMETYPE_EXT: { 'image/png': '.png', + 'image/gif': '.gif', + 'image/webp': '.webp', 'image/jpg': '.jpg', 'image/jpeg': '.jpg' }, @@ -605,9 +607,15 @@ const PREVIEWS_SIZE = { height: 480, minWidth: 400 } -const AVATARS_SIZE = { - width: 120, - height: 120 +const ACTOR_IMAGES_SIZE = { + AVATARS: { + width: 120, + height: 120 + }, + BANNERS: { + width: 1920, + height: 384 + } } const EMBED_SIZE = { @@ -755,7 +763,7 @@ if (isTestInstance() === true) { ACTIVITY_PUB.VIDEO_REFRESH_INTERVAL = 10 * 1000 // 10 seconds ACTIVITY_PUB.VIDEO_PLAYLIST_REFRESH_INTERVAL = 10 * 1000 // 10 seconds - CONSTRAINTS_FIELDS.ACTORS.AVATAR.FILE_SIZE.max = 100 * 1024 // 100KB + CONSTRAINTS_FIELDS.ACTORS.IMAGE.FILE_SIZE.max = 100 * 1024 // 100KB CONSTRAINTS_FIELDS.VIDEOS.IMAGE.FILE_SIZE.max = 400 * 1024 // 400KB SCHEDULER_INTERVALS_MS.actorFollowScores = 1000 @@ -816,7 +824,7 @@ export { SEARCH_INDEX, HLS_REDUNDANCY_DIRECTORY, P2P_MEDIA_LOADER_PEER_VERSION, - AVATARS_SIZE, + ACTOR_IMAGES_SIZE, ACCEPT_HEADERS, BCRYPT_SALT_SIZE, TRACKER_RATE_LIMITS, -- cgit v1.2.3