Module: Qiniu::Fop::Image
- Extended by:
- Utils
- Defined in:
- lib/qiniu/image.rb
Class Method Summary collapse
-
.exif(url) ⇒ Object
info.
- .generate_mogrify_params_string(options = {}) ⇒ Object
- .info(url) ⇒ Object
-
.mogrify_preview_url(source_image_url, options) ⇒ Object
exif.
Methods included from Utils
crc32checksum, debug, encode_entry_uri, http_request, safe_json_parse, send_request_with, urlsafe_base64_decode, urlsafe_base64_encode
Class Method Details
.exif(url) ⇒ Object
info
13 14 15 |
# File 'lib/qiniu/image.rb', line 13 def exif(url) return HTTP.api_get(url + '?exif') end |
.generate_mogrify_params_string(options = {}) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/qiniu/image.rb', line 21 def generate_mogrify_params_string( = {}) opts = {} .each do |k, v| opts[k.to_s] = v end params_string = "" keys = ["thumbnail", "gravity", "crop", "quality", "rotate", "format"] keys.each do |key| params_string += %Q(/#{key}/#{opts[key]}) unless opts[key].nil? end params_string += '/auto-orient' unless opts["auto_orient"].nil? 'imageMogr' + URI.escape(params_string) end |
.info(url) ⇒ Object
9 10 11 |
# File 'lib/qiniu/image.rb', line 9 def info(url) return HTTP.api_get(url + '?imageInfo') end |
.mogrify_preview_url(source_image_url, options) ⇒ Object
exif
17 18 19 |
# File 'lib/qiniu/image.rb', line 17 def mogrify_preview_url(source_image_url, ) source_image_url + '?' + generate_mogrify_params_string() end |