Skip to content

feat(image): add option to convert images to avif - #131

Open
BeanieMen wants to merge 2 commits into
hackclub:masterfrom
BeanieMen:master
Open

BeanieMen wants to merge 2 commits into
hackclub:masterfrom
BeanieMen:master

Conversation

@BeanieMen

Copy link
Copy Markdown

AI wasnt used to make this pull request
Resolves cdn-dev

uses previously commented dep image_processing gem to convert images to avif format

wasnt really sure where to put the option for automatic conversion, for now it is under the upload button
Shot-2026-09-25-113751

Copilot AI lite review requested due to automatic review settings September 25, 2026 06:20
@socket-security

socket-security Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedgem/​image_processing@​1.14.099100100100100

View full report

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

Unresolved issues remain with libvips provisioning, post-conversion quota enforcement, and synchronous batch processing.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 2 Medium severity

Open (2)
What changed in this PR

Adds default-enabled AVIF conversion for web batch uploads using image_processing/Vips.

Changes:

  • Adds AVIF conversion and metadata handling.
  • Wires the option through the controller and upload UI.
  • Adds dependencies and service/controller tests.
File Summary
test/​services/​batch_upload_service_test.rb Tests conversion behavior.
test/​controllers/​uploads_batch_test.rb Tests UI and controller integration.
Gemfile.lock Locks image-processing dependencies.
Gemfile Adds the image-processing dependency.
app/​services/​batch_upload_service.rb Implements AVIF conversion.
app/​controllers/​uploads_controller.rb Passes the conversion option.
app/​components/​uploads/​index.rb Adds the conversion checkbox.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread app/services/batch_upload_service.rb
Comment on lines +161 to +166
def convert_to_avif(file)
ImageProcessing::Vips
.source(file.tempfile.path)
.convert(:avif)
.saver(Q: 100)
.call

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

seems pointless. avif converesion is not slow by any means and adding a job for this adds additional overhead more than what would be needed.

awaiting further review

Comment thread app/services/batch_upload_service.rb Outdated

This branch has not been deployed

No deployments
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