Skip to content

Conversation

@FloDwld
Copy link
Contributor

@FloDwld FloDwld commented Oct 23, 2025

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.

@FloDwld FloDwld requested a review from boojack as a code owner October 23, 2025 20:35
@boojack boojack requested a review from Copilot October 23, 2025 23:38
Copy link
Contributor

Copilot AI left a 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, and thumbnailJpegQuality
  • 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant