From 76e562e7ac008217fcfaa0b651bd59666b21361b Mon Sep 17 00:00:00 2001 From: Rakshit Date: Mon, 7 Jul 2025 22:56:06 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=96=BC=EF=B8=8F=20docs:=20add=20`clientIm?= =?UTF-8?q?ageResize`=20configuration=20(#333)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../object_structure/config.mdx | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/pages/docs/configuration/librechat_yaml/object_structure/config.mdx b/pages/docs/configuration/librechat_yaml/object_structure/config.mdx index 582415e..fe5859d 100644 --- a/pages/docs/configuration/librechat_yaml/object_structure/config.mdx +++ b/pages/docs/configuration/librechat_yaml/object_structure/config.mdx @@ -149,9 +149,61 @@ see: [Web Search Object Structure](/docs/configuration/librechat_yaml/object_str ['endpoints', 'Record/Object', 'Specifies file handling configurations for individual endpoints, allowing customization per endpoint basis.', ''], ['serverFileSizeLimit', 'Number', 'The maximum file size (in MB) that the server will accept. Applies globally across all endpoints unless overridden by endpoint-specific settings.', ''], ['avatarSizeLimit', 'Number', 'Maximum size (in MB) for user avatar images.', ''], + ['clientImageResize', 'Object', 'Configures client-side image resizing to optimize file uploads and prevent upload errors due to large image sizes.', ''], ]} /> +## clientImageResize + +**Key:** + + +**Subkeys:** + + +**Description:** + +The `clientImageResize` configuration enables automatic client-side image resizing before upload. This feature helps: + +- **Prevent upload failures** due to large image files exceeding server limits +- **Reduce bandwidth usage** by compressing images before transmission +- **Improve upload performance** with smaller file sizes +- **Maintain image quality** while optimizing file size + +When enabled, images that exceed the specified `maxWidth` or `maxHeight` dimensions are automatically resized on the client side before being uploaded to the server. The resizing maintains the original aspect ratio while ensuring the image fits within the specified bounds. + +**Example:** +```yaml filename="clientImageResize" +fileConfig: + clientImageResize: + enabled: true + maxWidth: 1920 + maxHeight: 1080 + quality: 0.8 + compressFormat: "jpeg" +``` + +**Notes:** + +- Only applies to image files (JPEG, PNG, WebP, etc.) +- Resizing occurs automatically when images exceed the specified dimensions +- Original aspect ratio is preserved during resizing +- The feature works with all supported image upload endpoints +- Quality setting only applies to JPEG and WebP formats +- Setting quality too low (< 0.5) may result in noticeable image degradation + see: [File Config Object Structure](/docs/configuration/librechat_yaml/object_structure/file_config) ## rateLimits