Class: JekyllImgFlow::Providers::Flyimg

Inherits:
HttpBase show all
Defined in:
lib/jekyll-imgflow/providers/flyimg.rb

Overview

Flyimg provider implementation using the standardized tag interface

Constant Summary collapse

TIMEOUT =
60

Constants inherited from BaseProvider

BaseProvider::COMPASS_TO_SHORT, BaseProvider::KNOWN_OPERATIONS, BaseProvider::SMARTCROP_POSITIONS

Instance Attribute Summary

Attributes inherited from BaseProvider

#config

Instance Method Summary collapse

Methods inherited from HttpBase

#available?, #execute

Methods inherited from BaseProvider

#add_watermark, #alpha_byte_value, #alpha_opacity=, #available?, #check_http_service, #cli_available?, #compass_to_short, #convert_format, #crop, #crop_coords, #crop_geometry, #encode_file_url, #execute, #find_op, #format, #initialize, #input_format_ext, #op?, #opacity, #operations, #optimize, provider_name, #quality, #quality=, #relative_file_path, #reset_operations, #resize, #smartcrop_interestingness, supports_operation?, #supports_operation?, #temp_path, unsupported_operations, #watermark, #watermark_parts

Constructor Details

This class inherits a constructor from JekyllImgFlow::Providers::BaseProvider

Instance Method Details

#build_combined_flyimg_url(input_path) ⇒ Object



17
18
19
# File 'lib/jekyll-imgflow/providers/flyimg.rb', line 17

def build_combined_flyimg_url(input_path)
  build_combined_url(input_path)
end

#build_combined_url(input_path) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
# File 'lib/jekyll-imgflow/providers/flyimg.rb', line 21

def build_combined_url(input_path)
  raise "flyimg_url not set" unless service_url

  encoded_url = encode_file_url(input_path)
  options = []

  @operations.each { |operation| append_flyimg_operation(operation, options) }

  preserve_input_format(input_path, options)
  "#{service_url}/upload/#{options.join(',')}/#{encoded_url}"
end

#service_url ⇒ Object



13
14
15
# File 'lib/jekyll-imgflow/providers/flyimg.rb', line 13

def service_url
  @config.respond_to?(:flyimg_url) ? @config.flyimg_url : nil
end