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

Require ruby-vips before downloading blob #45448

Conversation

jonathanhefner
Copy link
Member

This ensures that if download_blob_to_tempfile raises an error before evaluating its block, rescue ::Vips::Error will not cause a NameError due to ruby-vips not being loaded yet.

This also prevents the blob from being downloaded if ruby-vips is not available to analyze it.

A similar change was made for Analyzer::ImageAnalyzer::ImageMagick in #45420.

This ensures that if `download_blob_to_tempfile` raises an error before
evaluating its block, `rescue ::Vips::Error` will not cause a
`NameError` due to `ruby-vips` not being loaded yet.

This also prevents the blob from being downloaded if `ruby-vips` is not
available to analyze it.

A similar change was made for `Analyzer::ImageAnalyzer::ImageMagick`
in rails#45420.
@jonathanhefner jonathanhefner force-pushed the active_storage-require-vips-before-download branch from 21b2fbd to c5133f0 Compare June 23, 2022 17:50
Copy link
Member

@skipkayhil skipkayhil left a comment

Choose a reason for hiding this comment

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

Looks good!

@jonathanhefner jonathanhefner merged commit d2c5d23 into rails:main Jun 23, 2022
jonathanhefner added a commit that referenced this pull request Jun 23, 2022
…vips-before-download

Require `ruby-vips` before downloading blob

(cherry picked from commit d2c5d23)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants