Fix boot failure without mini_magick for apps on the Vips transformer - #74
Merged
Merged
Conversation
flavorjones
force-pushed
the
issue-57-lazy-mini-magick
branch
from
September 29, 2026 22:29
0e7be83 to
13905b6
Compare
Requiring activestorage-hotcell-client loaded the ImageMagick transformer, whose Rails superclass requires mini_magick. Under image_processing 2.x, which no longer depends on mini_magick, an application on the Vips transformer failed to boot with LoadError. Autoload the ImageMagick transformer, so only an application that names it needs mini_magick. [Fix #57]
flavorjones
force-pushed
the
issue-57-lazy-mini-magick
branch
from
September 30, 2026 19:10
13905b6 to
0d53ad6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
activestorage-hotcell-clientships a transformer for each image backend:Transformers::Image::VipsandTransformers::Image::Magick. An application configures one of them asconfig.active_storage.variant_processor.require "active_storage/hot_cell/client"loads both. The Magick transformer subclasses Rails'ActiveStorage::Transformers::ImageMagick, and that file requiresimage_processing/mini_magick(client.rb:9,magick.rb:4).image_processing2.x no longer depends onmini_magick, so an application on the Vips transformer that does not installmini_magickfails to boot:Fizzy hit this in basecamp/fizzy#3056 and worked around it in basecamp/fizzy#3106 by bundling
mini_magickit does not use.Fixes #57
Details
client.rbautoloadsTransformers::Image::Magickinstead of requiring it. Requiring the gem no longer loadsmini_magick.mini_magickinstalled still getsimage_processing'sLoadError, at the point where it names the class.Analyzers::Image::Magick. It loads no ImageMagick code, so it stays required.mini_magick.rbstand-in that raisesLoadError, and cover both cases.