fix #2347
This commit is contained in:
@@ -195,12 +195,16 @@ class Post < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def large_image_width
|
def large_image_width
|
||||||
[Danbooru.config.large_image_width, image_width].min
|
if has_large?
|
||||||
|
[Danbooru.config.large_image_width, image_width].min
|
||||||
|
else
|
||||||
|
image_width
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def large_image_height
|
def large_image_height
|
||||||
ratio = Danbooru.config.large_image_width.to_f / image_width.to_f
|
ratio = Danbooru.config.large_image_width.to_f / image_width.to_f
|
||||||
if ratio < 1
|
if has_large? && ratio < 1
|
||||||
(image_height * ratio).to_i
|
(image_height * ratio).to_i
|
||||||
else
|
else
|
||||||
image_height
|
image_height
|
||||||
|
|||||||
Reference in New Issue
Block a user