Skip to content

FEATURE: automatically downsize large images#1

Open
ShashankFC wants to merge 1 commit into
image-processing-optimizationfrom
large-image-processing
Open

FEATURE: automatically downsize large images#1
ShashankFC wants to merge 1 commit into
image-processing-optimizationfrom
large-image-processing

Conversation

@ShashankFC

Copy link
Copy Markdown
Collaborator

@GitHoobar

Copy link
Copy Markdown

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ffbaf8c542

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +149 to +150
def self.downsize(from, to, dimensions, opts={})
optimize("downsize", from, to, dimensions, opts)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Remove duplicate downsize overload to avoid ArgumentError

This new downsize definition overwrites the earlier 4‑argument overload, so any caller still passing max_width, max_height (e.g. Jobs::ResizeEmoji in app/jobs/regular/resize_emoji.rb) will now raise ArgumentError: wrong number of arguments at runtime. This breaks emoji resizing whenever that job runs. Consider keeping a single method that accepts both styles or renaming the new percent/geometry variant to avoid clobbering the existing API.

Useful? React with 👍 / 👎.

Comment on lines 180 to 183
// check file size
var fileSizeKB = file.size / 1024;
var maxSizeKB = Discourse.SiteSettings['max_' + type + '_size_kb'];
var maxSizeKB = 10 * 1024; // 10MB
if (fileSizeKB > maxSizeKB) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Respect per‑type upload size settings in client validation

The client-side upload validation is now hard‑coded to 10 MB for both images and attachments. If an admin sets max_image_size_kb or max_attachment_size_kb above 10 MB, the UI will block those larger uploads before they reach the server, even though the server would accept them. This is a regression in configured behavior and will prevent legitimate uploads in those deployments.

Useful? React with 👍 / 👎.

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.

3 participants