instance method
read_image
Ruby on Rails 8.1.2
Since v7.0.10 PrivateSignature
read_image()
No documentation comment.
Source
# File activestorage/lib/active_storage/analyzer/image_analyzer/image_magick.rb, line 21
def read_image
unless MINIMAGICK_AVAILABLE
logger.error "Skipping image analysis because the mini_magick gem isn't installed"
return {}
end
download_blob_to_tempfile do |file|
image = instrument("mini_magick") do
MiniMagick::Image.new(file.path)
end
if image.valid?
yield image
else
logger.info "Skipping image analysis because ImageMagick doesn't support the file"
{}
end
rescue MiniMagick::Error => error
logger.error "Skipping image analysis due to an ImageMagick error: #{error.message}"
{}
end
end
Defined in activestorage/lib/active_storage/analyzer/image_analyzer/image_magick.rb line 21
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveStorage::Analyzer::ImageAnalyzer::ImageMagick