-
-
Couldn't load subscription status.
- Fork 3.2k
feat: configurable image downscaling upon upload #5184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds configurable image downscaling functionality for uploaded attachments. Images exceeding a configurable maximum dimension are automatically downscaled before storage, with customizable JPEG quality settings. The feature is disabled by default (value 0) and can be configured through the web interface's Storage settings.
- Adds four new storage configuration fields:
imageMaxSize,jpegQuality,thumbnailMaxSize, andthumbnailJpegQuality - Implements image downscaling logic that preserves aspect ratios and original format (PNG/JPEG)
- Updates storage settings UI with new configuration inputs and validation
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| proto/store/workspace_setting.proto | Defines new storage setting fields for image processing configuration |
| proto/api/v1/workspace_service.proto | Adds API-level storage setting fields for image downscaling |
| proto/gen/store/workspace_setting.pb.go | Generated protobuf code for store-level storage settings |
| proto/gen/api/v1/workspace_service.pb.go | Generated protobuf code for API-level workspace service |
| proto/gen/api/v1/user_service.pb.go | Minor formatting change in generated code comment |
| proto/gen/openapi.yaml | OpenAPI spec updates reflecting new storage configuration fields |
| web/src/types/proto/api/v1/workspace_service.ts | TypeScript types for new storage settings |
| web/src/components/Settings/StorageSection.tsx | UI components for configuring image downscaling settings |
| store/workspace_setting.go | Default values and initialization for new storage settings |
| server/router/api/v1/workspace_service.go | Converts storage settings between API and store representations |
| server/router/api/v1/attachment_service.go | Implements image downscaling logic during attachment creation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This pull request adds functionality to automatically downscale large JPEG and PNG images before they are stored in their respective storage location. The maximum size and quality are configurable via the web interface's Storage configuration.
By default, downscaling is deactivated (default value 0).
I'm sorry for the large amount of diffs due to the newly generated protobuf files. If you have any tips how to reduce the differences during protobuf generation, I'm happy to implement these.
As always, happy to hear your feedback.