Files
old-holivud2/app/helpers/images_helper.rb
2020-05-31 22:38:19 +02:00

41 lines
856 B
Ruby

module ImagesHelper
def thumbnail_variant(attachment)
attachment.variant(
gravity: "center",
resize: "75x75>",
extent: "75x75",
background: "#fff",
)
end
def medium_variant(attachment)
attachment.variant(
gravity: "center",
resize: "100x100>",
extent: "100x100",
background: "#fff",
)
end
def large_variant(attachment)
attachment.variant(
gravity: "center",
resize: "150x150>",
extent: "150x150",
background: "#fff",
)
end
def account_logo_variant(attachment)
attachment.variant(resize_to_fit: [200, 200])
end
def profile_variant(attachment)
attachment.variant(resize_to_fill: [100, 100, { gravity: "north" }])
end
def tiny_variant(attachment)
attachment.variant(resize_to_fill: [40, 40, { gravity: "north" }])
end
end