Skip to content

Conversation

@akshayutture-augment
Copy link

Copy link

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

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.

ℹ️ 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 145 to +151
def self.downsize(from, to, max_width, max_height, opts={})
optimize("downsize", from, to, max_width, max_height, opts)
optimize("downsize", from, to, "#{max_width}x#{max_height}", opts)
end

def self.optimize(operation, from, to, width, height, opts={})
dim = dimensions(width, height)
def self.downsize(from, to, dimensions, opts={})
optimize("downsize", from, to, dimensions, opts)
end

Choose a reason for hiding this comment

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

P1 Badge Preserve downsize width/height arity

The new definition of OptimizedImage.downsize at the bottom of this hunk overrides the existing (from, to, max_width, max_height, opts={}) method with one that only accepts a pre-formatted dimensions string. Every existing caller (e.g. Jobs::ResizeEmoji in app/jobs/regular/resize_emoji.rb:14) still passes width, height, and an options hash (5 arguments), so Ruby now raises ArgumentError: wrong number of arguments (5 for 4) as soon as those code paths run, breaking emoji resizing and any other downsize invocation. Please keep the original arity (or add a differently named helper) so callers that supply width/height continue to work while also supporting the new percentage-based use case.

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