0
0
Fork 0

Fix public channel

This commit is contained in:
Eugen Rochko 2016-10-23 11:56:04 +02:00
parent a9e40a3d80
commit abb8f5837e
5 changed files with 49 additions and 45 deletions

View file

@ -34,26 +34,28 @@ class MediaAttachment < ApplicationRecord
image? ? 'image' : 'video'
end
private
class << self
private
def self.file_styles(f)
if f.instance.image?
{
original: '100%',
small: '510x680>'
}
else
{
small: {
convert_options: {
output: {
vf: 'scale=\'min(510\, iw):min(680\, ih)\':force_original_aspect_ratio=decrease'
}
},
format: 'png',
time: 1
def file_styles(f)
if f.instance.image?
{
original: '100%',
small: '510x680>'
}
}
else
{
small: {
convert_options: {
output: {
vf: 'scale=\'min(510\, iw):min(680\, ih)\':force_original_aspect_ratio=decrease'
}
},
format: 'png',
time: 1
}
}
end
end
end
end