Sha256: 023381c41cf306243e945fe5c4e5bc8c6e6c2167da358033285a66b62332acd5
Contents?: true
Size: 562 Bytes
Versions: 9
Compression:
Stored size: 562 Bytes
Contents
module ActiveStorage # Extracts width and height in pixels from an image blob. # # Example: # # ActiveStorage::Analyzer::QiniuImageAnalyzer.new(blob).metadata # # => {:size=>39504, :format=>"gif", :width=>708, :height=>576, :colorModel=>"palette0", :frameNumber=>1} # class Analyzer::QiniuImageAnalyzer < Analyzer def self.accept?(blob) blob.image? end def metadata code, result, res = Qiniu::HTTP.api_get(blob.service.url(blob.key, fop: 'imageInfo')) result.symbolize_keys rescue {} end end end
Version data entries
9 entries across 9 versions & 1 rubygems