37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
# File 'app/models/pageflow/image_file.rb', line 37
def attachment_styles(attachment)
panorama_format = File.extname(attachment.original_filename) == '.png' ? :PNG : :JPG
Pageflow
.config.thumbnail_styles.transform_values { |options| options.merge(style_defaults) }
.merge(
print: {geometry: '300x300>',
**style_defaults,
convert_options: '-quality 10 -interlace Plane'},
medium: {geometry: '1024x1024>',
**style_defaults,
convert_options: '-quality 70 -interlace Plane'},
large: {geometry: '1920x1920>',
**style_defaults,
convert_options: '-quality 70 -interlace Plane'},
ultra: {geometry: '3840x3840>',
**style_defaults,
convert_options: '-quality 90 -interlace Plane'},
panorama_medium: {geometry: ImageFile.scale_down_to_cover(1024, 1024),
format: panorama_format,
convert_options: '-quality 90 -interlace Plane'},
panorama_large: {geometry: ImageFile.scale_down_to_cover(1920, 1080),
format: panorama_format,
convert_options: '-quality 90 -interlace Plane'}
)
end
|