richer news feed, change screenshots/thumbnails to use retina quality

This commit is contained in:
Kyle Drake 2014-09-17 20:13:14 -07:00
parent 45168341de
commit 1d200a886e
11 changed files with 69 additions and 36 deletions

View file

@ -44,7 +44,7 @@ class ScreenshotWorker
f.fetch(
output: screenshot_output_path,
width: 1280,
height: 720
height: 960
)
rescue Timeout::Error
# :nocov:
@ -89,7 +89,15 @@ class ScreenshotWorker
FileUtils.mkdir_p screenshot_path unless Dir.exists?(screenshot_path)
Site::SCREENSHOT_RESOLUTIONS.each do |res|
img.scale(*res.split('x').collect {|r| r.to_i}).write(File.join(user_screenshots_path, "#{path}.#{res}.jpg")) {
width, height = res.split('x').collect {|r| r.to_i}
if width == height
new_img = img.crop_resized width, height, Magick::NorthGravity
else
new_img = img.scale width, height
end
new_img.write(File.join(user_screenshots_path, "#{path}.#{res}.jpg")) {
self.quality = 90
}
end