Module: Stilts::Helpers
- Includes:
- ActionView::Helpers
- Defined in:
- lib/stilts/rails/helpers.rb
Instance Method Summary collapse
-
#logger ⇒ Object
- def stream_resize(image_source) b = Benchmark.measure do @params = Addressable::URI.parse(url.to_s) # TODO get URI.parse out of Addressable to remove the dependency @params.query_values = => image_source, :stream => “1” end # logger.debug { “STREAM BENCHMARK
-
#b“ }.
-
#transform_image(source, transform_options = {}, image_options = {}) ⇒ Object
Take image transform parameters and generate an image tag and stick it into the batch.
Instance Method Details
#logger ⇒ Object
def stream_resize(image_source)
b = Benchmark.measure do
@params = Addressable::URI.parse(url.to_s) # TODO get URI.parse out of Addressable to remove the dependency
@params.query_values = {:image_source => image_source, :stream => "1"}
end
# logger.debug { "STREAM BENCHMARK :: #{b}" }
stream_url = url
stream_url.path = "/resize"
stream_url.query = @params.query
stream_url.to_s
end
25 26 27 |
# File 'lib/stilts/rails/helpers.rb', line 25 def logger Stilts.configuration.logger end |
#transform_image(source, transform_options = {}, image_options = {}) ⇒ Object
Take image transform parameters and generate an image tag and stick it into the batch
6 7 8 9 10 |
# File 'lib/stilts/rails/helpers.rb', line 6 def transform_image(source, = {}, = {}) image = Stilts::Image.new(source, ).deliver # @image_batch << image image_tag(image["url"], ) end |