Skip to content
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

Make image resizing Vips compatible #95

Merged
merged 10 commits into from
Jul 19, 2024

Conversation

danieldiekmeier
Copy link
Contributor

@danieldiekmeier danieldiekmeier commented Jul 19, 2024

Until now, we used the ImageMagick exclusive "200x300>" syntax, so any project that uses shimmer is forced to also use ImageMagick. Since Vips is much much faster, we want to switch. But first, we have to adjust Shimmer to be compatible.

This was not too hard since we mostly don't leak the ImageMagick-style strings to the outside. We persist them in the generated id (which is used in the URLs). The message_verifier.generate method can encode arbitrary data, so we don't use these strings anymore from now on. Instead, we directly save [width, height] tuples.

BUT we don't want all our URLs to change at once: This would break any hotlinked URLs (maybe not a big deal), but also invalidate all our caches. So we grandfather in old URLs for now. Maybe we can remove them in 10 years.

Since we're switching to the ImageProcessing-style resize_to_limit: [width, height] format, this new version should in theory be compatible with BOTH ImageMagick AND Vips.

Some apps, like Copa, use FileProxy directly and pass a ImageMagick-style string. These need to be fixed before we can upgrade Shimmer there. https://github.com/search?q=org%3Anerdgeschoss+FileProxy&type=code

(This PR also includes a little overhaul to CI and the Rails test app.)

Bonus: Fixes #59. Rubocop works for all three Ruby versions in the matrix now.

@danieldiekmeier danieldiekmeier changed the title Make image resizing processor independent Make image resizing Vips compatible Jul 19, 2024
@danieldiekmeier danieldiekmeier added the backend requires a backend developer label Jul 19, 2024
@danieldiekmeier danieldiekmeier self-assigned this Jul 19, 2024
@JensRavens JensRavens closed this Jul 19, 2024
@JensRavens JensRavens reopened this Jul 19, 2024
@JensRavens JensRavens merged commit 2f41a1e into main Jul 19, 2024
3 checks passed
@JensRavens JensRavens deleted the make-scaling-processor-independent branch July 19, 2024 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend requires a backend developer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix Linting on Ruby 3.1
3 participants