Class: JekyllImgFlow::Providers::Imgproxy
- Inherits:
-
HttpBase
- Object
- BaseProvider
- HttpBase
- JekyllImgFlow::Providers::Imgproxy
- Defined in:
- lib/jekyll-imgflow/providers/imgproxy.rb
Overview
Imgproxy provider implementation using the standardized tag interface
Constant Summary collapse
- TIMEOUT =
seconds
10
Constants inherited from BaseProvider
BaseProvider::COMPASS_TO_SHORT, BaseProvider::KNOWN_OPERATIONS, BaseProvider::SMARTCROP_POSITIONS
Instance Attribute Summary
Attributes inherited from BaseProvider
Instance Method Summary collapse
- #build_combined_imgproxy_url(input_path) ⇒ Object
- #build_combined_url(input_path) ⇒ Object
- #service_url ⇒ Object
Methods inherited from HttpBase
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_imgproxy_url(input_path) ⇒ Object
17 18 19 |
# File 'lib/jekyll-imgflow/providers/imgproxy.rb', line 17 def build_combined_imgproxy_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 32 |
# File 'lib/jekyll-imgflow/providers/imgproxy.rb', line 21 def build_combined_url(input_path) raise "imgproxy_url not set" unless service_url encoded_url = encode_file_url(input_path) operations = [] @operations.each { |operation| append_imgproxy_operation(operation, operations) } preserve_input_format(input_path, operations) operations_path = operations.join("/") "#{service_url}/insecure/#{operations_path}/plain/#{encoded_url}" end |
#service_url ⇒ Object
13 14 15 |
# File 'lib/jekyll-imgflow/providers/imgproxy.rb', line 13 def service_url @config.respond_to?(:imgproxy_url) ? @config.imgproxy_url : nil end |