Kill trailing whitespace in ruby files
This commit is contained in:
@@ -7,28 +7,28 @@ module Danbooru
|
||||
# wider than it is tall
|
||||
geometry = "#{Danbooru.config.small_image_width}x#{Danbooru.config.small_image_width}>"
|
||||
end
|
||||
|
||||
|
||||
image.change_geometry(geometry) do |new_width, new_height, img|
|
||||
img.resize!(new_width, new_height)
|
||||
width = new_width
|
||||
height = new_height
|
||||
end
|
||||
|
||||
|
||||
image = flatten(image, width, height)
|
||||
|
||||
|
||||
image.write(write_path) do
|
||||
self.quality = resize_quality
|
||||
end
|
||||
|
||||
|
||||
image.destroy!
|
||||
FileUtils.chmod(0664, write_path)
|
||||
end
|
||||
|
||||
|
||||
def flatten(image, width, height)
|
||||
if image.alpha?
|
||||
# since jpeg can't represent transparency, we need to create an image list,
|
||||
# put a white image on the bottom, then flatten it.
|
||||
|
||||
|
||||
list = Magick::ImageList.new
|
||||
list.new_image(width, height) do
|
||||
self.background_color = "#FFFFFF"
|
||||
|
||||
Reference in New Issue
Block a user