Module: Refinery::Admin::ImagesHelper

Defined in:
images/app/helpers/refinery/admin/images_helper.rb

Instance Method Summary collapse

Instance Method Details

#other_image_viewsObject



4
5
6
7
8
# File 'images/app/helpers/refinery/admin/images_helper.rb', line 4

def other_image_views
  Refinery::Images.image_views.reject { |image_view|
    image_view.to_s == Refinery::Images.preferred_image_view.to_s
  }
end

#thumbnail_urls(image) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
# File 'images/app/helpers/refinery/admin/images_helper.rb', line 10

def thumbnail_urls(image)
  thumbnail_urls = {
    :data-original" => asset_paths.compute_public_path(image.url, ''),
    :data-grid" => asset_paths.compute_public_path(image.thumbnail('135x135#c').url, '')
  }

  Refinery::Images.user_image_sizes.sort_by{|key,geometry| geometry}.each do |size, pixels|
    thumbnail_urls[:data-#{size.to_s.parameterize}"] = asset_paths.compute_public_path(image.thumbnail(pixels).url, '')
  end

  thumbnail_urls
end