fixes for screenshot worker

This commit is contained in:
Kyle Drake 2014-08-20 13:48:20 -07:00
parent 0aca6b3328
commit fbf78f04d6
8 changed files with 69 additions and 2 deletions

View file

@ -80,7 +80,9 @@ class ScreenshotWorker
img = img_list.reverse.flatten_images
user_screenshots_path = File.join SCREENSHOTS_PATH, username
FileUtils.mkdir_p user_screenshots_path
screenshot_path = File.join user_screenshots_path, File.dirname(path)
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")) {