Restore support to analyze image blobs with image_magick
#55718
Merged
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 / Background
Since 93c00a8,
config.active_storage.analyzerscontains both vips and image magick analyzers. However, they both inherit fromAnalyzer::ImageAnalyzer, which means they just check forblob.image?to check if they should accept the image.That means that even if the user explicitly does
variant_processor = :mini_magick, vips gets called first (because it comes first in the array), and image magick never gets a chance to do anything.Before that commit it worked because the analyzers were conditionally added to the array, so there was only ever one or the other present.
This fixes this by once again implementing custom
accept?, which was previously removed in e978ef0Checklist
Before submitting the PR make sure the following are checked:
[Fix #issue-number]