Class: Alchemy::PicturesController
Constant Summary
collapse
- ALLOWED_IMAGE_TYPES =
%w(png jpeg gif)
Instance Method Summary
collapse
Methods included from Modules
included, #module_definition_for, register_module
#configuration, #multi_language?, #multi_site?
Instance Method Details
#show ⇒ Object
11
12
13
14
15
16
|
# File 'app/controllers/alchemy/pictures_controller.rb', line 11
def show
@size = params[:size]
expires_in 1.month, public: !@picture.restricted?
respond_to { |format| send_image(processed_image, format) }
end
|
#thumbnail ⇒ Object
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'app/controllers/alchemy/pictures_controller.rb', line 18
def thumbnail
case params[:size]
when 'small' then @size = '80x60'
when 'medium' then @size = '160x120'
when 'large' then @size = '240x180'
when nil then @size = '111x93'
else
@size = params[:size]
end
respond_to { |format| send_image(processed_image, format) }
end
|
#zoom ⇒ Object
31
32
33
|
# File 'app/controllers/alchemy/pictures_controller.rb', line 31
def zoom
respond_to { |format| send_image(@picture.image_file, format) }
end
|