change to use cropped thumbnails
This commit is contained in:
@@ -3,8 +3,14 @@ module Danbooru
|
|||||||
image = Magick::Image.read(read_path).first
|
image = Magick::Image.read(read_path).first
|
||||||
|
|
||||||
if width == Danbooru.config.small_image_width
|
if width == Danbooru.config.small_image_width
|
||||||
image.change_geometry("#{width}x#{height}>") do |small_width, small_height, img|
|
image.change_geometry("#{width}x#{height}^") do |small_width, small_height, img|
|
||||||
img.thumbnail!(small_width, small_height)
|
if width > height
|
||||||
|
gravity = Magick::WestGravity
|
||||||
|
else
|
||||||
|
gravity = Magick::NorthGravity
|
||||||
|
end
|
||||||
|
|
||||||
|
img.reseize_to_fill!(small_width, small_height, gravity)
|
||||||
width = small_width
|
width = small_width
|
||||||
height = small_height
|
height = small_height
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user