This commit is contained in:
r888888888
2013-06-07 15:51:57 -07:00
parent 5791492b9b
commit 0b6cafbac0
2 changed files with 10 additions and 0 deletions

View File

@@ -153,6 +153,10 @@ class Post < ActiveRecord::Base
end
module ImageMethods
def twitter_card_supported?
file_size <= 1.megabyte && image_width.to_i >= 280 && image_height.to_ >= 150
end
def has_large?
is_image? && image_width.present? && image_width > Danbooru.config.large_image_width
end